ESLint InterlaceESLint Interlace
Plugin: import-nextRules

order

ESLint rule documentation for order

šŸ“” Live from GitHub — This documentation is fetched directly from order.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.

Enforces a specific order for import statements

Rule Details

This rule aims to prevent issues related to order.

Options

[
  {
    "type": "object",
    "properties": {
      "groups": {
        "type": "array",
        "items": {
          "type": "string",
          "enum": [
            "builtin",
            "external",
            "internal",
            "parent",
            "sibling",
            "index",
            "object",
            "type",
            "side-effect"
          ]
        }
      },
      "internalPatterns": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "alphabetize": {
        "type": "object",
        "properties": {
          "order": {
            "type": "string",
            "enum": [
              "asc",
              "desc",
              "ignore"
            ]
          },
          "caseInsensitive": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "newlinesBetween": {
        "type": "string",
        "enum": [
          "always",
          "never",
          "ignore"
        ]
      }
    },
    "additionalProperties": false
  }
]

Implementation

OWASP Foundation

  • Category: A00:2021 - General Security

Edit this page on GitHub →

On this page

No Headings