eslint-plugin-eslint-config

raw JSON →
2.0.0 verified Sat Apr 25 auth: no javascript maintenance

ESLint plugin for linting ESLint configuration files, ensuring they are valid and consistent. Current stable version is 2.0.0, released January 2021, with a slow release cadence focused on bug fixes. Key differentiators: validates exported configs via execution, provides presets (recommended-rules, rc, all), and includes rules for deprecated/unknown rules and sorting. Requires ESLint >=5 and Node >=10, with peer dependency on eslint.

error ESLint configuration is invalid: "eslint-config" is not a known plugin.
cause Plugin name in plugins array is misspelled or missing.
fix
Add 'eslint-config' to plugins array and ensure eslint-plugin-eslint-config is installed.
error Plugin package 'eslint-plugin-eslint-config' not found.
cause Package not installed or ESLint cannot locate it.
fix
Run npm install --save-dev eslint-plugin-eslint-config or yarn add --dev eslint-plugin-eslint-config.
error Cannot read property 'no-deprecated-rules' of undefined
cause Using the rule with a missing or misconfigured plugin.
fix
Verify plugin is installed and added to plugins array, then use rule as 'eslint-config/no-deprecated-rules'.
error ESLint configuration is invalid: "eslint-config/rc" invalid preset.
cause Extending a preset that doesn't exist or wrong path.
fix
Use configs.rc or extend 'plugin:eslint-config/rc' from ESLint config (note: 'eslint-config' is the plugin prefix).
breaking Dropped support for Node 8 in v2.0.0.
fix Upgrade Node to v10 or higher.
breaking Updated @typescript-eslint/experimental-utils to v4 in v2.0.0, potentially breaking TypeScript users.
fix Ensure @typescript-eslint packages are compatible; if using TypeScript, update to match.
deprecated The 'all' preset may change in any release; not recommended for long-term consistency.
fix Use 'recommended-rules' or 'rc' instead for stable base.
gotcha Rules execute the config files they lint; can trigger side effects. Should only be applied to specific files via overrides.
fix Use overrides to limit rules to ESLint config files only.
gotcha Plugin name must be 'eslint-config' (without 'eslint-plugin-') in plugins array, or 'eslint-config' as a string.
fix Set plugins: ['eslint-config'] in your ESLint config.
npm install eslint-plugin-eslint-config
yarn add eslint-plugin-eslint-config
pnpm add eslint-plugin-eslint-config

Enables eslint-plugin-eslint-config in an ESLint config file, applying rules to ESLint config files.

// .eslintrc.js
module.exports = {
  plugins: ['eslint-config'],
  overrides: [
    {
      files: ['.eslintrc.js', 'my-config.js'],
      rules: {
        'eslint-config/no-deprecated-rules': 'warn',
        'eslint-config/no-invalid-config': 'error',
        'eslint-config/no-unknown-rules': 'error',
        'eslint-config/sort-rules': 'warn'
      }
    }
  ]
};