-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Option to disallow "var" keyword with esnext: true #1549
Comments
The |
Why are they obsolete? |
The implementation is limited to strict-mode only, which is incorrect. I suppose for node.js purposes, this is not a problem, but it remains an issue in code that is expected to run in browsers: IE11 is implemented correctly, Chrome (w/ flags on) is limited to strict-mode and Firefox is an ancient implementation that's so wrong it doesn't even count. To be clear, I definitely support a future "novar" (or whatever) flag, but it's important to understand the consequences before jumping to something like that. |
You're right that it depends on the environment whether you can fully rely on As usual there should be a sane default. |
I find that compelling enough to +1 |
relevant discussion: |
@caitp @jugglinmike are either of you interested in this one? |
I guess if it's a linting rule people want, why not? |
thanks for this @caitp 👍 |
esnext: true
adds support forlet
andconst
which makevar
obsolete in most cases, esp. in node.js environments. It would be great to have an option to warn about variables declared withvar
since its usage is most likely a mistake in ES6 files.The text was updated successfully, but these errors were encountered: