@delagen/eslint-plugin-deprecation
TypeScript icon, indicating that this package has built-in type declarations

1.3.2 • Public • Published

eslint-plugin-deprecation

Build Status 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.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.3.2
    2,749
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.3.2
    2,749
  • 1.3.0
    0

Package Sidebar

Install

npm i @delagen/eslint-plugin-deprecation

Weekly Downloads

2,749

Version

1.3.2

License

LGPL-3.0-or-later

Unpacked Size

36 kB

Total Files

16

Last publish

Collaborators

  • delagen