You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior:
Property 'a' does not exist on type 'object'.ts(2339)
Actual behavior:
compile time: no 2339 error or indication in VS Code
run time: obj.a = undefined
Description
Visual Studio code and running tsc will produce error 2339 when the comment directive is removed. When adding in the comment // @ts-ignore both Visual Studio code and tsc will ignore the error. However, misspelling ts-ignore as ts-ignoree or ts-ignoreThisShouldNotMatchButItDoes will invoke the @ts-ignore directive and ignore the error.
I didn't test other directives to see whether they had similar issues... trying to keep things simple, but this issue could be symptomatic of all comment directives, assuming they re-use the same code for parsing.
TypeScript Version: typescript@4.0.0-dev.20200526
NodeJS Version: v12.16.2
Visual Studio Code:
Search Terms: comment directive, @ts-ignore
Code
Expected behavior:
Property 'a' does not exist on type 'object'.ts(2339)
Actual behavior:
compile time: no 2339 error or indication in VS Code
run time: obj.a = undefined
Description
Visual Studio code and running tsc will produce error 2339 when the comment directive is removed. When adding in the comment
// @ts-ignore
both Visual Studio code and tsc will ignore the error. However, misspellingts-ignore
asts-ignoree
orts-ignoreThisShouldNotMatchButItDoes
will invoke the@ts-ignore
directive and ignore the error.I didn't test other directives to see whether they had similar issues... trying to keep things simple, but this issue could be symptomatic of all comment directives, assuming they re-use the same code for parsing.
Playground Link: https://www.typescriptlang.org/play/?target=6&jsx=0&ssl=2&ssc=13&pln=2&pc=41#code/DYUwLgBA9gRgVhAvBA3hAvgKAPTYgATAGcBaASwHMA7KAJxABUALMogZSagFdgATAOShgAsgEMwAYyYAhLmACSYACJQQRTBKhUiUUADpgUCgAoIAA1hw9opBAAkKS9fRmIASkxA
Related Issues: None that I could find. Searched under @ts-ignore, comment directive
The text was updated successfully, but these errors were encountered: