ESLint plugin
This project is maintained by iliubinskii
ESLint plugin / typescript/no-unsafe-object-assignment
Reports unsafe object assignments:
module.exports = {
plugins: ["misc"],
rules: {
"misc/typescript/no-unsafe-object-assignment": "error"
}
};
interface ReadonlyObject { readonly value: number; }
interface WritableObject { value: number; }
const x: ReadonlyObject = { value: 1 };
function f(x: WritableObject) {}
f(x);
interface ReadonlyObject { readonly value: number; }
interface WritableObject { value: number; }
const x: WritableObject = { value: 1 };
function f(x: ReadonlyObject) {}
f(x);