Giter Site home page Giter Site logo

eslint-index's Introduction

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

Option Alias Description Arg Type Arg Options
--help -h Display help Boolean N/A
--docs -d Display docs alongside rules Boolean N/A
--format -f Format rules String `list
--status -s Filter rules by status Array<String> `omitted
--groups -g Filter rules by group/plugin Array<String> `eslint
--include -i Filter rules by id Array<String> rule-id-one rule-id-two
--exclude -e Reject rules by id Array<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

eslint-index's People

Contributors

wagerfield avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.