eslint-plugin-eslint-plugin
An ESLint plugin for linting ESLint plugins
Last updated 6 months ago by eslint-community-bot .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install eslint-plugin-eslint-plugin 
SYNC missed versions from official npm registry.

eslint-plugin-eslint-plugin CI NPM version Conventional Commits

An ESLint plugin for linting ESLint plugins. Rules written in CJS, ESM, and TypeScript are all supported.

Installation

You'll first need to install ESLint:

npm i eslint --save-dev

Next, install eslint-plugin-eslint-plugin:

npm install eslint-plugin-eslint-plugin --save-dev

Usage

Here's an example ESLint configuration that:

  • Sets sourceType to script for CJS plugins (most users) (use module for ESM/TypeScript)
  • Enables the recommended configuration
  • Enables an optional/non-recommended rule

.eslintrc.json

{
  "extends": ["plugin:eslint-plugin/recommended"],
  "rules": {
    "eslint-plugin/require-meta-docs-description": "error"
  }
}

eslint.config.js (requires eslint>=v8.23.0)

const eslintPlugin = require('eslint-plugin-eslint-plugin');
module.exports = [
  eslintPlugin.configs['flat/recommended'],
  {
    rules: {
      'eslint-plugin/require-meta-docs-description': 'error',
    },
  },
];

Rules

💼 Configurations enabled in.
✅ Set in the recommended configuration.
🔧 Automatically fixable by the --fix CLI option.
💡 Manually fixable by editor suggestions.
💭 Requires type information.

Rules

Name Description 💼 🔧 💡 💭
fixer-return require fixer functions to return a fix ✅
meta-property-ordering enforce the order of meta properties 🔧
no-deprecated-context-methods disallow usage of deprecated methods on rule context objects ✅ 🔧
no-deprecated-report-api disallow the version of context.report() with multiple arguments ✅ 🔧
no-missing-message-ids disallow messageIds that are missing from meta.messages ✅
no-missing-placeholders disallow missing placeholders in rule report messages ✅
no-property-in-node disallow using in to narrow node types instead of looking at properties 💭
no-unused-message-ids disallow unused messageIds in meta.messages ✅
no-unused-placeholders disallow unused placeholders in rule report messages ✅
no-useless-token-range disallow unnecessary calls to sourceCode.getFirstToken() and sourceCode.getLastToken() ✅ 🔧
prefer-message-ids require using messageId instead of message or desc to report rule violations ✅
prefer-object-rule disallow function-style rules ✅ 🔧
prefer-placeholders require using placeholders for dynamic report messages
prefer-replace-text require using replaceText() instead of replaceTextRange()
report-message-format enforce a consistent format for rule report messages
require-meta-docs-description require rules to implement a meta.docs.description property with the correct format
require-meta-docs-recommended require rules to implement a meta.docs.recommended property
require-meta-docs-url require rules to implement a meta.docs.url property 🔧
require-meta-fixable require rules to implement a meta.fixable property ✅
require-meta-has-suggestions require suggestable rules to implement a meta.hasSuggestions property ✅ 🔧
require-meta-schema require rules to implement a meta.schema property ✅ 💡
require-meta-type require rules to implement a meta.type property ✅

Tests

Name Description 💼 🔧 💡 💭
consistent-output enforce consistent use of output assertions in rule tests
no-identical-tests disallow identical tests ✅ 🔧
no-only-tests disallow the test case property only ✅ 💡
prefer-output-null disallow invalid RuleTester test cases where the output matches the code ✅ 🔧
test-case-property-ordering require the properties of a test case to be placed in a consistent order 🔧
test-case-shorthand-strings enforce consistent usage of shorthand strings for test cases with no options 🔧

Presets

Name Description
✅ recommended enables all recommended rules in this plugin
rules-recommended enables all recommended rules that are aimed at linting ESLint rule files
tests-recommended enables all recommended rules that are aimed at linting ESLint test files
all enables all rules in this plugin, excluding those requiring type information
all-type-checked enables all rules in this plugin, including those requiring type information
rules enables all rules that are aimed at linting ESLint rule files
tests enables all rules that are aimed at linting ESLint test files

Semantic versioning policy

The list of recommended rules will only change in a major release of this plugin. However, new non-recommended rules might be added in a minor release of this plugin. Therefore, using the all, rules, and tests presets is not recommended for production use, because the addition of new rules in a minor release could break your build.

Preset usage

Both flat and eslintrc configs are supported. For example, to enable the recommended preset, use:

eslint.config.js

const eslintPlugin = require('eslint-plugin-eslint-plugin');
module.exports = [eslintPlugin.configs['flat/recommended']];

.eslintrc.json

{
  "extends": ["plugin:eslint-plugin/recommended"]
}

Or to apply linting only to the appropriate rule or test files:

eslint.config.js

const eslintPlugin = require('eslint-plugin-eslint-plugin');
module.exports = [
  {
    files: ['lib/rules/*.{js,ts}'],
    ...eslintPlugin.configs['flat/rules-recommended'],
  },
  {
    files: ['tests/lib/rules/*.{js,ts}'],
    ...eslintPlugin.configs['flat/tests-recommended'],
  },
];

.eslintrc.js

{
  "overrides": [
    {
      "files": ["lib/rules/*.{js,ts}"],
      "extends": ["plugin:eslint-plugin/rules-recommended"]
    },
    {
      "files": ["tests/lib/rules/*.{js,ts}"],
      "extends": ["plugin:eslint-plugin/tests-recommended"]
    }
  ]
}

Current Tags

  • 6.2.0                                ...           latest (6 months ago)

74 Versions

  • 6.2.0                                ...           6 months ago
  • 6.1.0                                ...           8 months ago
  • 6.0.0                                ...           8 months ago
  • 5.5.1                                ...           9 months ago
  • 5.5.0                                ...           9 months ago
  • 5.4.1                                ...           9 months ago
  • 5.4.0                                ...           10 months ago
  • 5.3.0                                ...           a year ago
  • 5.2.1                                ...           a year ago
  • 5.2.0                                ...           a year ago
  • 5.1.1                                ...           a year ago
  • 5.1.0                                ...           2 years ago
  • 5.0.8                                ...           2 years ago
  • 5.0.7                                ...           2 years ago
  • 5.0.6                                ...           2 years ago
  • 5.0.5                                ...           2 years ago
  • 5.0.4                                ...           2 years ago
  • 5.0.3                                ...           2 years ago
  • 5.0.2                                ...           2 years ago
  • 5.0.1                                ...           2 years ago
  • 5.0.0                                ...           2 years ago
  • 4.4.1                                ...           2 years ago
  • 4.4.0                                ...           2 years ago
  • 4.3.0                                ...           3 years ago
  • 4.2.0                                ...           3 years ago
  • 4.1.0                                ...           3 years ago
  • 4.0.3                                ...           3 years ago
  • 4.0.2                                ...           3 years ago
  • 4.0.1                                ...           3 years ago
  • 4.0.0                                ...           3 years ago
  • 4.0.0-3                                ...           3 years ago
  • 4.0.0-2                                ...           3 years ago
  • 4.0.0-1                                ...           3 years ago
  • 4.0.0-0                                ...           3 years ago
  • 3.6.1                                ...           3 years ago
  • 3.6.0                                ...           3 years ago
  • 3.5.3                                ...           3 years ago
  • 3.5.2                                ...           3 years ago
  • 3.5.1                                ...           3 years ago
  • 3.5.0                                ...           3 years ago
  • 3.4.0                                ...           3 years ago
  • 3.3.0                                ...           3 years ago
  • 3.2.0                                ...           4 years ago
  • 3.1.0                                ...           4 years ago
  • 3.0.3                                ...           4 years ago
  • 3.0.2                                ...           4 years ago
  • 3.0.1                                ...           4 years ago
  • 3.0.0                                ...           4 years ago
  • 2.3.0                                ...           5 years ago
  • 2.2.2                                ...           5 years ago
  • 2.2.1                                ...           5 years ago
  • 2.2.0                                ...           5 years ago
  • 2.1.0                                ...           6 years ago
  • 2.0.1                                ...           6 years ago
  • 2.0.0                                ...           6 years ago
  • 1.4.1                                ...           6 years ago
  • 1.4.0                                ...           7 years ago
  • 1.3.0                                ...           7 years ago
  • 1.2.0                                ...           7 years ago
  • 1.1.0                                ...           7 years ago
  • 1.0.0                                ...           7 years ago
  • 0.8.0                                ...           7 years ago
  • 0.7.4                                ...           7 years ago
  • 0.7.3                                ...           7 years ago
  • 0.7.2                                ...           8 years ago
  • 0.7.1                                ...           8 years ago
  • 0.7.0                                ...           8 years ago
  • 0.6.0                                ...           8 years ago
  • 0.5.0                                ...           8 years ago
  • 0.4.0                                ...           8 years ago
  • 0.3.0                                ...           8 years ago
  • 0.2.1                                ...           8 years ago
  • 0.2.0                                ...           8 years ago
  • 0.1.0                                ...           8 years ago

© 2010 - cnpmjs.org x YWFE | Home | YWFE