1.5.0 • Published 6 years ago

eslint-index v1.5.0

Weekly downloads
862
License
MIT
Repository
github
Last release
6 years ago

ESLint ESLint Index

CLI for finding and managing rules in ESLint config files

List all the rules!

Demo 1

Then count them, or create a pretty table!

Demo 2

Installation

npm install eslint-index --save-dev

Usage

eslint-index path/to/.eslintrc [options]

This package is intended to be used as a local utility.

It needs both eslint and the eslint-plugins referenced in the .eslintrc.* config file, to be installed alongside it.

Using it as a global utility will throw an error if eslint and the eslint-plugins referenced in the .eslintrc.* config file are not installed globally.

It is recommended that you use it within your package.json scripts:

"scripts": {
  "list-rules": "eslint-index .eslintrc",
  "count-rules": "eslint-index .eslintrc --format number",
  "table-rules": "eslint-index .eslintrc --format table",
  "list-rules-with-docs": "eslint-index .eslintrc --docs",
  "list-eslint-rules": "eslint-index .eslintrc --groups eslint",
  "list-disabled-rules": "eslint-index .eslintrc --status omitted off"
}

Alternatively, you can add ./node_modules/.bin to your $PATH.

This will allow you to use any node binaries within your project:

» cd some-project-with-eslint-index-installed
» which eslint-index
./node_modules/.bin/eslint-index
» eslint-index .eslintrc --format table
┌──────────┬─────────┬─────────┬─────────┬─────────┬─────────┐
│          │ total   │ omitted │ off     │ warn    │ error   │
├──────────┼─────────┼─────────┼─────────┼─────────┼─────────┤
│ eslint   │ 233     │ 0       │ 29      │ 2       │ 202     │
├──────────┼─────────┼─────────┼─────────┼─────────┼─────────┤
│ react    │ 53      │ 4       │ 0       │ 0       │ 49      │
└──────────┴─────────┴─────────┴─────────┴─────────┴─────────┘

Options

OptionAliasDescriptionArg TypeArg Options
--help-hDisplay helpBooleanN/A
--docs-dDisplay docs alongside rulesBooleanN/A
--format-fFormat rulesStringlist|table|number
--status-sFilter rules by statusArray<String>omitted|off|warn|error
--groups-gFilter rules by group/pluginArray<String>eslint|plugin eg. react
--include-iFilter rules by idArray<String>rule-id-one rule-id-two
--exclude-eReject rules by idArray<String>rule-id-one rule-id-two

Examples

eslint-index .eslintrc --format table
eslint-index .eslintrc --format number
eslint-index .eslintrc --status omitted off
eslint-index .eslintrc --status warn error
eslint-index .eslintrc --groups eslint react
eslint-index .eslintrc --groups eslint --status warn error
eslint-index .eslintrc --groups eslint --status warn error --format number
eslint-index .eslintrc --include semi curly
eslint-index .eslintrc --exclude semi curly
eslint-index .eslintrc --docs
eslint-index .eslintrc --groups eslint react --docs

Author

Matthew Wagerfield @wagerfield

1.5.0

6 years ago

1.4.0

7 years ago

1.3.0

7 years ago

1.1.1

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago

0.9.0

7 years ago

0.8.0

7 years ago

0.7.0

7 years ago

0.6.0

7 years ago

0.5.0

7 years ago

0.4.0

7 years ago

0.3.0

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago