eslint-plugin-misc

ESLint plugin

This project is maintained by iliubinskii

typescript/prefer-enum

ESLint plugin / typescript/prefer-enum

Requires using enums instead of string literals.

module.exports = {
  plugins: ["misc"],
  rules: {
    "misc/typescript/prefer-enum": "error"
  }
};

Examples of incorrect code

type T = "a" | "b";

Examples of correct code

enum T {
  a = "a",
  b = "b"
};