eslint-plugin-misc

ESLint plugin

This project is maintained by iliubinskii

consistent-enum-members

ESLint plugin / consistent-enum-members

Requires consistent key-value pairs inside enums (key should match value).

module.exports = {
  plugins: ["misc"],
  rules: {
    "misc/consistent-enum-members": [
      "error",
      {
        overrides: [
          {
            _id: string,
            filesToLint: string[],
            filesToSkip: string[],
            format: "PascalCase" | "camelCase" | "kebab-case",
            selector: string | string[]
          },
          ...
        ]
      }
    ]
  }
};

| Option | Description | Default | | :—– | :———- | :—— |

overrides._id Id -
overrides.filesToLint Files to lint (minimatch patterns) []
overrides.filesToSkip Files to skip (minimatch patterns) []
overrides.format Overrides default file name format -
overrides.selector Triggers override when AST element matching AST selector is found -

Examples of incorrect code

enum Enum {
  a = "b"
}

Examples of correct code

enum Enum {
  a = "a"
}