Skip to main content


Disallow unsafe declaration merging.

TypeScript's "declaration merging" supports merging separate declarations with the same name.

Declaration merging between classes and interfaces is unsafe. The TypeScript compiler doesn't check whether properties are initialized, which can cause lead to TypeScript not detecting code that will cause runtime errors.

interface Foo {
nums: number[];

class Foo {}

const foo = new Foo();

foo.nums.push(1); // Runtime Error: Cannot read properties of undefined.
module.exports = {
"rules": {
"@typescript-eslint/no-unsafe-declaration-merging": "error"
Try this rule in the playground ↗


interface Foo {}

class Foo {}

Further Reading


This rule is not configurable.