ESLint InterlaceESLint Interlace
Plugin: import-nextRules

prefer-modern-api

ESLint rule documentation for prefer-modern-api

šŸ“” Live from GitHub — This documentation is fetched directly from prefer-modern-api.md and cached for 6 hours.

šŸ’¼ This rule is enabled in the following configs: recommended, typescript. šŸ’” This rule is automatically fixable by the --fix CLI option.

Suggest modern replacements for deprecated or outdated libraries

Rule Details

This rule aims to prevent issues related to prefer-modern-api.

Options

[
  {
    "type": "object",
    "properties": {
      "customMappings": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "deprecated": {
              "type": "string"
            },
            "modern": {
              "type": "string"
            },
            "reason": {
              "type": "string"
            },
            "difficulty": {
              "type": "string",
              "enum": [
                "easy",
                "medium",
                "hard"
              ]
            },
            "migrationGuide": {
              "type": "string"
            }
          },
          "required": [
            "deprecated",
            "modern",
            "reason"
          ]
        }
      },
      "disableBuiltIn": {
        "type": "boolean",
        "default": false
      }
    },
    "additionalProperties": false
  }
]

Implementation

OWASP Foundation

  • Category: A00:2021 - General Security

Edit this page on GitHub →

On this page

No Headings