Skip to content

Improve error message TS1210 #44892

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

henriqueinonhe
Copy link
Contributor

Changes error message TS1210 from:

Invalid use of '{0}'. Class definitions are automatically in strict mode.

to

Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of '{0}'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode.

as suggested.

Fixes #44765

@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Jul 4, 2021
@ghost
Copy link

ghost commented Jul 4, 2021

CLA assistant check
All CLA requirements met.

@Ark-kun
Copy link

Ark-kun commented Jul 17, 2021

Maybe we can say something like

Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of the legacy built-in variable '{0}'. The name '{0}' is reserved in strict mode. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode.

as per #44765 (comment)

Basically, we need to tell the beginners: "You cannot name your variable 'arguments'" and tell experienced JS developers "You cannot use the magical 'arguments' variable in strict mode."

@DanielRosenwasser DanielRosenwasser merged commit 7753efa into microsoft:main Aug 6, 2021
BobobUnicorn pushed a commit to BobobUnicorn/TypeScript that referenced this pull request Oct 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Backlog Bug PRs that fix a backlog bug
Projects
Archived in project
5 participants