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
Add option to ignore deprecated rules. #3039
Comments
Have you tried running eslint with |
Here is a minimal example:
Given the previous example, the obvious work-around could be using
But that won't work if devs use different versions of eslint. |
What if we override the severity of all depreciation errors to warnings? Then the |
Changing errors to warnings is a step in the right direction, but still of no use if I don't disable warnings in my vim plugin. Logic like |
Sorry, maybe I'm not fully understanding what you are asking for, but what's stopping you from having your personal config (the one that has |
Yes, that should work (setting the removed rules to |
This is a temporary problem with the introduction of 1.0.0, so I don't think any change is necessary. You shouldn't be relying on 1.0.0-rc-1 in production right now. You can revert to 0.24.1, which will still have all the rules you're looking for. Once 1.0.0 is final, there will be a one-time cost of updating configs, but we will never get there if we let people optionally hide these messages. So I'd suggest reverting to 0.24.1 until the dependency has had time to upgrade. Otherwise, setting those files to 0 in your config is the best way to go. |
@ilyavolodin My "personal config that has extends" is checked in in a shared repository, so I thought that editing it and setting the rules to 0 would cause rules to be overlooked if others use an older versions of @nzakas If we shouldn't be relying on 1.0.0-rc-1, why is that version published on npm and thus when Setting all rules to 0 is a reasonable way to work around my problem, but another issue with this is that we eventually end up with bloated eslint configuration files. A new flag to check for deprecated/unknown keys would be nice. In particular, this new tool should also be able to report unknown/deprecated rules in parent eslintrc (so that removing |
@Rob--W We released RC1 to gather feedback from the users. That's sort of a whole point of RC. We released it as latest, because we are still not at 1.0.0, so theoretically, you shouldn't really rely on this in production (although ESLint has been stable enough for a while). |
@Rob--W yeah, I messed up by making it work with 1.0.0-rc-1 already flags unknown and deprecated rules when run, as will 1.0.0, so I believe we have our bases covered. There's just a weird moment in time right now between RC 1 and 1.0.0. |
@nzakas As seen in one of my previous comments, rules with value 0 are not (And this might be a temporary situation for now, but what will happen when
|
When we will release v2 RC, we will not mark it as latest. |
@Rob--W we don't check rules that are turned off because they can't affect execution. |
@nzakas They don't affect execution, but they do take up space in the eslintrc files. Having an option to validate rule definitions would be nice. That nice-to-have is not related to my initial issue, and my issue has several work-arounds, so I'll close this ticket. If you think that this suggestion is indeed a nice feature, feel free to open a new ticket for it. |
With #2920 and #1549, eslint will unconditionally print a warning when a deprecated rule is encountered. This patch still has a huge issue, which becomes apparent in the following scenario:
Ideally, every eslintrc in the chain would only use valid options. In the real world, this is not always the case. I could submit a patch to the third-party to fix their .eslintrc, but meanwhile my workflow is disturbed by the eslint warnings, because there is no way to disable deprecated rules *.
What I'm requesting is a way to disable deprecation warnings. E.g. any of the following:
'no-inherit'
).* currently, the only work-around is to define the deprecated rule in a rulesdir, which in turn imports the replacement (or is a no-op).
The text was updated successfully, but these errors were encountered: