eslint-index
See original GitHub issueI have created a ESLint utility module inspired by eslint-find-rules
that I thought you might find useful for eslint-config-airbnb-base
and eslint-config-airbnb
.
The module is called eslint-index
and you can read the full documentation on npm.
eslint-index
provides a great deal of functionality including:
- List all available rules declared by ESLint and any plugins you have included
- Colour code rules depending on their status:
omitted
(not declared anywhere in you ESLint config file)0|off
(declared, but set to0|off
)1|warn
2|error
- Display links to the rule documentation page next to each rule
- Filter/reject rules by their
status
and/or theirgroup
status
is as described above (omitted|off|warn|error
)group
iseslint
for the core ESLint rules or the name of any of your plugins likereact|import|flowtype
- Format the output as a number or a table to get an overview of your rule settings
- Rules that have been marked as deprecated are removed from all outputs
- All of the above filters and formatting can be combined, for example:
filter
omitted
andoff
rules, output them as alist
and display the ruledoc
links alongsidefilter
eslint
rules and display the rule setting counters in atable
I wrote this plugin to aid the development of my own ESLint config settings and found it incredibly useful for keeping track of everything. I hope you find this module useful and please do let me know if you have any ideas on how to improve it.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:6
Top Results From Across the Web
eslint-index - npm
ESLint Index. CLI for finding and managing rules in ESLint config files. List all the rules! Demo 1. Then count them, or ...
Read more >Rules - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >eslint-plugin-react/no-array-index-key.md at master - GitHub
The key is used by React to identify which items have changed, are added, or are removed and should be stable. It's a...
Read more >create-eslint-index - npm Package Health Analysis - Snyk
Learn more about create-eslint-index: package health score, popularity, security, maintenance, versions and more.
Read more >consistent-indexed-object-style - TypeScript ESLint
"index-signature" : only allow index signatures. record . ❌ Incorrect; ✓ Correct. /* eslint @typescript-eslint ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I developed the tool to assist me in writing a config for my company (
eslint-config-supermind
). With so many rules available in ESLint itself plus all the rules provided by plugins, I found it difficult to keep track of which rules I had used and which ones I hadn’t. This became all the more difficult when upgradingeslint
and any plugins—I wouldn’t know what new rules had been added.eslint-find-rules
went a long way in helping with this, but I felt it lacked the granular functionality I desired—so I developedeslint-index
. Being able to filter rules by status (omitted|off|warn|error
), by plugin (react|jsx-a11y
) or the core eslint rules and having doc urls outputted alongside rules in the console has been very useful to me.For example, if I upgrade
eslint
or any plugins and want to see which rules I haven’t specified (because they are new) and for these omitted rules, display links to the docs alongside, I can do:Correct - that’s what i’m hoping for 😃
Absent that, this tool might still be very useful, but I haven’t yet grasped what specific problem it solves for me.