Comments (14)
I've reported an issue upstream that would help for this & similar use cases: eslint/eslint#7021 (and that would expose a proper API instead of having to hack into the internal ESLint package structure).
from eslint-find-rules.
I would be happy to accept that PR on eslint-plugin-react. eslint-plugin-import has some deprecated rules as well, iirc.
from eslint-find-rules.
I'll try to work on a PR on eslint-plugin-react, but it might be a week or so before I can get to it. If anyone else wants to do it before then, feel free.
eslint-plugin-import just added its first deprecated rule in 2.0, but it's really just a rename of one rule to another, and it doesn't warn about the deprecated name when running it. I'll look at submitting a PR for that as well at my next opportunity.
from eslint-find-rules.
The ESLint PR has landed; I created an issue to switch to the new API: #211. Once that's done, this issue should be easily solvable.
from eslint-find-rules.
From what I can see, it could work for plugin rules too, if we're careful with the format of the rule (ESLint v2 and v3 format), and if they copy the same meta info behavior as ESLint.
The only downside to this, is that you'd need to require all core rules to find out whether they're deprecated, which would make the tool quite a lot slower I'm guessing, but it could be done only if needed, when the right flags are activated (if requiring all those rules is indeed that slow).
from eslint-find-rules.
from eslint-find-rules.
look here for news on this: eslint/eslint#6525
from eslint-find-rules.
I looked into doing this at one point and I really love the idea of having this feature.
From my earlier research, I only found one plugin that had deprecated rules (eslint-plugin-react), and it doesn't add a deprecated
flag to the metadata. Instead, it exports a deprecatedRules
property alongside its rules
property.
It might be worth doing a couple of things:
- Submit a PR to eslint-plugin-react to add the
deprecated
property to its rule metadata. - Update the ESLint plugin documentation to recommend doing that in all plugins.
Does anyone know of any other plugins that have deprecated rules? What do they do?
from eslint-find-rules.
An example of a rule that is deprecated, but is flagged by eslint-find-rules as being unused is react/no-comment-textnodes.
from eslint-find-rules.
@mgol @randycoulman Can we push this forward?
I see there's a PR that requires a review.
Or is there anything else missing?
from eslint-find-rules.
We can't do anything here until #237 has been merged. Once that's done, we'll have to refactor a bit to use the new API to get the full rule definitions (we only use the rule names right now). Then we can filter out the deprecated rules.
from eslint-find-rules.
Looking forward to this
from eslint-find-rules.
Now that #237 has been merged, this can be started. I plan to get to it as soon as I can, but I'm a bit busy right now and it might be a week before I get to it. If someone else wants to run with it, go for it - just let me know so I don't duplicate effort.
from eslint-find-rules.
It'd be good to cut a major release before merging this new option, imo.
from eslint-find-rules.
Related Issues (20)
- Release new version with support eslint@5 HOT 1
- print as list HOT 2
- Scoped plugin error HOT 4
- eslint v6 support HOT 15
- Security warning for "mem" HOT 12
- Doesn't find unused rules in @typescript-eslint/eslint-plugin HOT 4
- Support overrides HOT 14
- eslint v7 support
- Handle typescript-eslint configuration HOT 1
- git clone error on windows HOT 6
- I'm not sure how to deal with renamed rule in ESLint 7.4.0 HOT 7
- Find unused plugin rules
- CHANGELOG missing HOT 3
- Breaks with ESLint 7.8.0 HOT 4
- Update dependencies HOT 5
- Support ESLint 8.x HOT 2
- Add support to the `rule.meta.docs.url` property to get URLs in verbose mode
- Rules in the "rules" json key are not being considered HOT 1
- No Option Provided with `--option` described in docs HOT 1
- Not able to save output as single column HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eslint-find-rules.