Skip to content

Variable named exports is not type-checkedΒ #52197

@guilhermesimoes

Description

@guilhermesimoes

Bug Report

πŸ•— Version & Regression Information

This is the behavior in every version I tried: v3.3.3 and v4.9.4

⏯ Playground Link

Playground link with relevant code

πŸ’» Code

let a: number;
a = ''; // Type 'string' is not assignable to type 'number'.

let exports: number;
exports = ''; // Everything is fine

πŸ™ Actual behavior

Variable named exports is not type-checked.

πŸ™‚ Expected behavior

Either the variable exports should be type-checked or the variable should not be allowed to be named exports (as far as I could tell exports is not a reserved word).

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions