Skip to content

[ID] --isolatedDeclarations disallows const initialized with a regex literalΒ #58383

Open
@Conaclos

Description

@Conaclos

πŸ” Search Terms

  • isolatedDeclarations
  • isolated declaration

βœ… Viability Checklist

⭐ Suggestion

I an unsure if it is a bug or a feature request...

An exported const without type annotation and initialized with a regex literal triggers the following error error TS9010: Variable must have an explicit type annotation with --isolatedDeclarations. in isolated declaration mode.

If I understand correctly, isolated declaration should allow unannotated const initialized with any literal?

πŸ“ƒ Motivating Example

See an example on the playground.

πŸ’» Use Cases

This could avoid a trivial type annotation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions