Introducing npm Teams! Private packages + team management tools.Learn more »

all-eslint-rules

6.0.0 • Public • Published

all-eslint-rules

npm version GitHub Actions codecov

Get all available ESLint rules

const allEslintRules = require('all-eslint-rules');
 
allEslintRules();
//=> ['accessor-pairs', 'array-bracket-newline', 'array-bracket-spacing', ...]

Installation

Use npm.

npm install all-eslint-rules

API

const allEslintRules = require('all-eslint-rules');

allEslintRules([options])

options: Object | CLIEngine
Return: string[]

It returns an Array of available ESLint rule names – the built-in ones and the ones defined by external plugins. Deprecated rules are excluded.

const rules = allEslintRules();
 
// Both indent-legacy and no-spaced-func are deprecated.
rules.includes('indent-legacy'); //=> false
rules.includes('no-spaced-func'); //=> false

The optional parameter accepts either a plain Object to set CLIEngine options or an already instantiated CLIEngine, and affects the result.

// When eslint-plugin-promise https://www.npmjs.com/package/eslint-plugin-promise is installed
 
allEslintRules({
  useEslintrc: false,
  plugins: []
}).includes('promise/param-names'); //=> false
 
allEslintRules({
  useEslintrc: false,
  plugins: ['promise']
}).includes('promise/param-names'); //=> true

License

ISC License © 2018 - 2019 Watanabe Shinnosuke

Install

npm i all-eslint-rules

DownloadsWeekly Downloads

558

Version

6.0.0

License

ISC

Unpacked Size

4.7 kB

Total Files

4

Last publish

Collaborators

  • avatar