Skip to content

ipasechnikov/eslint-plugin-deprecated-rules

Repository files navigation

eslint-plugin-deprecated-rules

Warns about deprecated or removed ESLint rules in ESLint config.

This small plugin was created for the purpose of finding whether our team of developers is using deprecated rules for the currently installed version of ESLint. Meaning, if you are using an older version of ESLint and a rule got deprecated in newer versions, then you won't get any warnings.

This plugin's rules work both for ESLint core rules, as well as rules provided by 3rd-party plugins.

Table of Contents

Installation

You'll first need to install ESLint:

npm i eslint --save-dev

Next, install eslint-plugin-deprecated-rules:

npm install eslint-plugin-deprecated-rules --save-dev

Usage

There are 2 main ways to use this package:

  • Add plugin and its rules manually
  • Extend recommended config provided by the plugin

Option 1. Add plugin and its rules

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

{
    "plugins": [
        "deprecated-rules"
    ]
}

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

{
    "rules": {
        "deprecated-rules/no-deprecated-rules": "warn"
    }
}

Option 2. Extend recommended config

{
    "extends": [
        "plugin:deprecated-rules/recommended"
    ]
}

Rules

⚠️ Configurations set to warn in.
✅ Set in the recommended configuration.

Name Description ⚠️
no-deprecated-rules Warns for ESLint deprecated rules

Built With

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

License

This project is licensed under the MIT License - see the LICENSE file for details.