-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Disable --noImplcitAny
, --noImplicitThis
and --strictNullChecks
in .js files
#14617
Comments
|
The compiler can not get TDZ right all the time. in .ts files if the compiler misses, users can use the non-null assertion operator for instance: var x;
setx();
x++;
function setx() {
x = 0;
} So either we report the error, and users can not disable it, or not report the error at all. |
What I'm wondering is whether TypeScript will be able to flag this specific error: x // ReferenceError
let x // or `class x`
|
that is a different error. block scoped variables are flagged if used before they are declared in general, this is not impacted by |
It would be a huge downgrade to deactivate all these options. I'm a JS/TS trainer, so I've played with the new I've seen no issue with For And in all cases (like in TS by the way), strict modes are options : so if a project don't want (or can't) be strict, then it just have to not activate those options (which is the default). But that would be a very bad news to disable strict modes for those who want them. |
Seems like too many folks are using |
--noImplicitAny
is set for the whole compilation.--strictNullChecks
fornull
andundefined
types should stay, but errors likeVariable is used before being assigned
orObject is possibly undefined
should be disabled.This allows for users to mix and match .ts and .js files, and enable strict checks for the .ts files without having errors in the .js file
The text was updated successfully, but these errors were encountered: