Skip to main content
interlace
Plugin: import-nextRules

no-deprecated

Forbid imported names marked with @deprecated documentation tag

💼 This rule is enabled in the following configs: recommended, typescript. 💡 This rule is manually fixable by editor suggestions.

Rule Details

This rule aims to prevent issues related to deprecated.

Options

[
  {
    "type": "object",
    "properties": {
      "allow": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "List of deprecated items that are allowed (for migration periods)"
      },
      "deprecationMarkers": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "default": [
          "@deprecated"
        ],
        "description": "Custom deprecation markers to look for in comments"
      },
      "checkJSDoc": {
        "type": "boolean",
        "default": true,
        "description": "Check for @deprecated in JSDoc comments"
      },
      "checkDecorators": {
        "type": "boolean",
        "default": true,
        "description": "Check for @deprecated decorator in TypeScript"
      }
    },
    "additionalProperties": false
  }
]

Implementation

OWASP Foundation

  • Category: A09:2021 - Security Logging and Monitoring Failures

Use this rule

npm install -D oxlint-plugin-import-next
.oxlintrc.json
{  "jsPlugins": ["oxlint-plugin-import-next"],  "rules": {    "import-next/no-deprecated": "error"  }}
vite.config.ts
import { defineConfig } from 'vite-plus';export default defineConfig({  lint: {    jsPlugins: ['oxlint-plugin-import-next'],    rules: {      'import-next/no-deprecated': 'error',    },  },});

oxlint-plugin-import-next re-exports eslint-plugin-import-next/oxlint: the same rules under the same IDs, and no ESLint install. Why oxlint.

Did this rule catch something? Star the repo to get new CWE coverage as we ship it — or follow the AI-code-security benchmarks behind these rules.