JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 764389
  • Score
    100M100P100Q188021F
  • License LGPL-3.0-or-later

ESLint rule that reports usage of deprecated code

Package Exports

  • eslint-plugin-deprecation
  • eslint-plugin-deprecation/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (eslint-plugin-deprecation) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

eslint-plugin-deprecation

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

An ESLint rule that reports usage of deprecated code.

Prerequisites

If you already use TypeScript and one or more rules from the typescript-eslint plugin, then eslint-plugin-deprecation will work out of the box without any additional dependencies or special configuration specified in this section. (This is because @typescript-eslint/plugin automatically contains @typescript-eslint/parser and your ESLint should already be configured with the parserOptions to work properly with TypeScript.)

Otherwise, in order for you to use this plugin, you must also install the following dependencies:

  • typescript
  • @typescript-eslint/parser

For example, if you use the npm package manager, then you would run the following command in the root of your project:

npm install --save-dev typescript @typescript-eslint/parser

Next, you must 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 a new one.
  }
}

Install

For example, if you use the npm package manager, then you would run the following command in the root of your project:

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

Setup

The easiest way to use this plugin is to extend from the recommended config, like this:

{
  "extends": [
    "plugin:deprecation/recommended",
  ],
}

The recommended config will enable the plugin and enable the deprecation/deprecation rule with a value of error.

Manually Enable the Plugin and Rule

If you don't want to use the recommended config for some reason, you can accomplish the same thing by specifying the following config:

{
  "plugins": [
    "deprecation",
  ],

  "rules": {
    "deprecation/deprecation": "error",
  },
}

Credits

This rule was originally ported from the SonarJS repository.