eslint-plugin-eslint-plugin
raw JSON → 7.3.2 verified Sat Apr 25 auth: no javascript
An ESLint plugin that provides a set of rules for linting ESLint plugins themselves. It helps plugin authors follow best practices, avoid deprecated APIs, and maintain consistency in meta properties and tests. As of v7.3.2, it requires ESLint >=9.0.0 and Node >=20.19.0. Version 7 broke compatibility with ESLint v8 and flat config prefixes. It supports CJS, ESM, and TypeScript plugin source files. Ships with recommended configs and autofix rules. Maintained under the eslint-community organization.
Common errors
error Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/node_modules/eslint-plugin-eslint-plugin/dist/index.js from /path/to/eslint.config.js not supported. ↓
cause ESM-only package since v7, but using require() in a CommonJS context.
fix
Use import() or switch to an ESM config file (e.g., rename eslint.config.js to eslint.config.mjs).
error ESLint couldn't find the plugin 'eslint-plugin-eslint-plugin'. ↓
cause In flat config, the plugin must be imported and passed as an object with a 'plugins' key, or used via the configs object. The string name is not recognized.
fix
Use: import eslintPlugin from 'eslint-plugin-eslint-plugin'; then add eslintPlugin.configs.recommended (or { plugins: { 'eslint-plugin': eslintPlugin } }).
error Configuration for rule 'eslint-plugin/require-meta-docs-description' is invalid. Value "error" is unknown. ↓
cause The rule may not exist or may have been renamed/removed. In v7, some rules were removed or renamed.
fix
Check the list of rules in the docs. For v7, ensure the rule name is correct (e.g., 'require-meta-docs-description' still exists).
error Cannot find module 'eslint-plugin-eslint-plugin' ↓
cause The package is not installed or not in node_modules.
fix
Run: npm install eslint-plugin-eslint-plugin --save-dev
Warnings
breaking v7.0.0 dropped support for ESLint v8 and the old eslintrc config format. The 'flat/' prefix from config paths is removed; configs are now directly on eslintPlugin.configs. ↓
fix Upgrade to ESLint >=9.0.0 and use flat config. Use eslintPlugin.configs.recommended instead of eslint-plugin-eslint-plugin/flat/recommended.
breaking v7.0.0 enabled several existing rules as recommended: no-meta-replaced-by, no-meta-schema-default, require-meta-default-options, require-meta-schema-description. These were previously optional. ↓
fix If you were explicitly disabling these rules, you may need to adjust your config. Check the recommended preset: it now includes them.
gotcha The package is ESM-only since v7.0.0. Using require() in CommonJS will throw an error. ↓
fix Use import or dynamic import(). If you need CJS, stick to v6.x.
deprecated The no-deprecated-context-methods rule flags use of context.getSource(), context.getFilename(), etc. These methods are deprecated in ESLint. ↓
fix Use context.sourceCode.getText() instead of context.getSource(), context.filename instead of context.getFilename(), etc.
gotcha The plugin uses the 'eslint-plugin' prefix by convention in flat config. If you import the plugin with a different name, rule references must match that name. ↓
fix When using flat config, assign the import to a variable and use that variable name as the plugin prefix in rule names.
breaking v6.0.0 removed support for Node.js <18.18.0. If you need older Node, stick to v5.x. ↓
fix Upgrade Node to >=18.18.0 or use older plugin version.
Install
npm install eslint-plugin-eslint-plugin yarn add eslint-plugin-eslint-plugin pnpm add eslint-plugin-eslint-plugin Imports
- plugin (default export) wrong
const eslintPlugin = require('eslint-plugin-eslint-plugin')correctimport eslintPlugin from 'eslint-plugin-eslint-plugin' - flat config (recommended) wrong
require('eslint-plugin-eslint-plugin/flat/recommended')correcteslintPlugin.configs.recommended - rules (legacy eslintrc) wrong
plugins: ['eslint-plugin-eslint-plugin']correctplugins: ['eslint-plugin']
Quickstart
// eslint.config.js
import eslintPlugin from 'eslint-plugin-eslint-plugin';
export default [
eslintPlugin.configs.recommended,
{
rules: {
'eslint-plugin/fixer-return': 'error',
},
},
];