eslint-plugin-misc

ESLint plugin

This project is maintained by iliubinskii

typescript/prefer-readonly-set

ESLint plugin / typescript/prefer-readonly-set

Disallows writable sets.

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

Examples of incorrect code

function f(x: Set<string>) {}

Examples of correct code

function f(x: ReadonlySet<string>) {}