eslint-plugin-misc

ESLint plugin

This project is maintained by iliubinskii

typescript/prefer-readonly-map

ESLint plugin / typescript/prefer-readonly-map

Disallows writable maps.

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

Examples of incorrect code

function f(x: Map<string, string>) {}

Examples of correct code

function f(x: ReadonlyMap<string, string>) {}