https://github.com/shinnn/all-eslint-rules
Get all available ESLint rules
https://github.com/shinnn/all-eslint-rules
Last synced: 6 months ago
JSON representation
Get all available ESLint rules
- Host: GitHub
- URL: https://github.com/shinnn/all-eslint-rules
- Owner: shinnn
- License: isc
- Created: 2015-09-03T11:20:44.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2019-06-26T19:19:50.000Z (over 6 years ago)
- Last Synced: 2024-10-18T19:55:58.966Z (12 months ago)
- Language: JavaScript
- Homepage: https://npm.runkit.com/all-eslint-rules
- Size: 131 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# all-eslint-rules
[](https://www.npmjs.com/package/all-eslint-rules)
[](https://wdp9fww0r9.execute-api.us-west-2.amazonaws.com/production/results/shinnn/all-eslint-rules)
[](https://codecov.io/gh/shinnn/all-eslint-rules)Get all available [ESLint](https://eslint.org) rules
```javascript
const allEslintRules = require('all-eslint-rules');allEslintRules();
//=> ['accessor-pairs', 'array-bracket-newline', 'array-bracket-spacing', ...]
```## Installation
[Use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/about-npm/).
```
npm install all-eslint-rules
```## API
```javascript
const allEslintRules = require('all-eslint-rules');
```### allEslintRules([*options*])
*options*: `Object | CLIEngine`
Return: `string[]`It returns an `Array` of available [ESLint](https://github.com/eslint/eslint) rule names – [the built-in ones](https://eslint.org/docs/rules/) and the ones defined by external [plugins](https://eslint.org/docs/user-guide/configuring#configuring-plugins). [Deprecated](https://eslint.org/docs/rules/#deprecated) rules are excluded.
```javascript
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`](https://eslint.org/docs/developer-guide/nodejs-api#cliengine) options or an already instantiated `CLIEngine`, and affects the result.
```javascript
// When eslint-plugin-promise https://www.npmjs.com/package/eslint-plugin-promise is installedallEslintRules({
useEslintrc: false,
plugins: []
}).includes('promise/param-names'); //=> falseallEslintRules({
useEslintrc: false,
plugins: ['promise']
}).includes('promise/param-names'); //=> true
```## License
[ISC License](./LICENSE) © 2018 - 2019 Watanabe Shinnosuke