unconfigured-eslint-rules
Detect unconfigured ESLint rules
/* ./eslintrc.js: module.exports = { rules: { 'no-alert': 'error', 'no-array-constructor': 'warn', 'no-bitwise': 'off', 'linebreak-style': ['error', "unix"], } }*/ const unconfiguredESLintRules = ;const unconfigured = ; //=> ['no-caller', 'no-catch-shadow', 'no-class-assign', ...] unconfigured; //=> falseunconfigured; //=> falseunconfigured; //=> falseunconfigured; //=> false
This module is designed to help developing sharable configs. When a developer updates ESLint and the latest version introduces new rules, unconfiguredESLintRules().length
increases and they'll notice those new rules. @shinnn/eslint-config
provides a real world example of this approach.
Installation
npm install unconfigured-eslint-rules
API
const unconfiguredEslintRules = ;
unconfiguredEslintRules([options])
options: Object
(ESLint CLIEngine
constructor options)
Return: string[]
The API is the same as configured-eslint-rules', but returns the inverse – an Array
of rule names with no rule configurations.
/* ./my-dir/.eslintrc.json: { "rules": { "semi": ["error", "always"] } }*/ ; //=> true process; ; //=> false
The argument will be directly passed to the underlying CLIEngine
constructor and affects the result.
/* ./eslintrc.yml: rules: eqeqeq: warn*/ ; //=> false; //=> true
License
ISC License © 2018 - 2019 Watanabe Shinnosuke