ESLint plugin
This project is maintained by iliubinskii
ESLint plugin / typescript/prefer-readonly-array
Disallows writable arrays.
module.exports = {
plugins: ["misc"],
rules: {
"misc/typescript/prefer-readonly-array": "error"
}
};
function f(x: string[]) {}
function g(x: [string]) {}
function h(x: Array<string>) {}
function f(x: readonly string[]) {}
function g(x: readonly [string]) {}
function h(x: ReadonlyArray<string>) {}