All Projects → gund → eslint-plugin-deprecation

gund / eslint-plugin-deprecation

Licence: LGPL-3.0 license
ESLint rule that reports usage of deprecated code

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

eslint-plugin-deprecation

Test Workflow Release Workflow Maintainability Npm Npm Downloads Size Licence semantic-release

ESLint rule that reports usage of deprecated code

Prerequisites

This plugin only works with @typescript-eslint/parser.

Which means that you should install dev deps:

  • @typescript-eslint/parser
  • typescript

Then configure ESLint to parse TypeScript and include type information:

{
  "parser": "@typescript-eslint/parser",
  "parserOptions": {
    "ecmaVersion": 2020,
    "sourceType": "module",
    "project": "./tsconfig.json" // <-- Point to your project's tsconfig.json or create new one
  }
}

Install

Install the plugin

npm i -D eslint-plugin-deprecation

Setup

Now add deprecation plugin and rule to your .eslintrc:

{
  "plugins": ["deprecation", ...],
  "rules": {
    "deprecation/deprecation": "warn", // or "error" to have stricter rule
    ...
  }
}

Now eslint will report all deprecated code that you use!


NOTE: This rule was ported from https://github.com/SonarSource/SonarJS repository.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].