platinumazure / eslint-plugin-eslint-plugin

An ESLint plugin for linting ESLint plugins

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

eslint-plugin-eslint-plugin Build Status

An ESLint plugin for linting ESLint plugins

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

Note: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-eslint-plugin globally.

Usage

Add eslint-plugin to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
    "plugins": [
        "eslint-plugin"
    ]
}

Then configure the rules you want to use under the rules section.

{
    "rules": {
        "eslint-plugin/no-deprecated-report-api": "error"
    }
}

Supported Rules

โœ”๏ธ indicates that a rule is recommended for all users. ๐Ÿ›  indicates that a rule is fixable.

Name โœ”๏ธ ๐Ÿ›  Description
no-deprecated-report-api โœ”๏ธ ๐Ÿ›  Prohibits the deprecated context.report(node, message) API
report-message-format Enforces a consistent format for report messages
require-meta-fixable โœ”๏ธ Requires a meta.fixable property for fixable rules
no-missing-placeholders โœ”๏ธ Disallows missing placeholders in rule report messages
test-case-shorthand-strings ๐Ÿ›  Enforces consistent usage of shorthand strings for test cases with no options
prefer-placeholders Disallows template literals as report messages
no-useless-token-range โœ”๏ธ ๐Ÿ›  Disallows unnecessary calls to sourceCode.getFirstToken and sourceCode.getLastToken
consistent-output Enforces consistent use of output assertions in rule tests
no-identical-tests Disallows identical tests

Supported Presets

Presets are enabled by adding a line to the extends list in your config file. For example, to enable the recommended preset, use:

{
    "extends": [
        "plugin:eslint-plugin/recommended"
    ]
}
  • recommended enables all recommended rules from 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.

  • rules enables all rules that are aimed at linting ESLint rule files.

  • tests enables all rules that are aimed at linting ESLint test files.

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, the 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.

About

An ESLint plugin for linting ESLint plugins

License:MIT License


Languages

Language:JavaScript 100.0%