eslint-plugin-misc

ESLint plugin

This project is maintained by iliubinskii

no-unnecessary-as-const

ESLint plugin / no-unnecessary-as-const

Disallows unnecessary “as const”.

module.exports = {
  plugins: ["misc"],
  rules: {
    "misc/no-unnecessary-as-const": "error"
  }
};

Examples of incorrect code

const x = {} as const;
const y: I = { value: 1 } as const;

Examples of correct code

const x = { value: 1 } as const;