Skip to main content


Disallow duplicate class members.


The code problem checked by this ESLint rule is automatically checked by the TypeScript compiler. Thus, it is not recommended to turn on this rule in new TypeScript projects. You only need to enable this rule if you prefer the ESLint error messages over the TypeScript compiler error messages.

此规则扩展了基本 eslint/no-dupe-class-members 规则。 它添加了对 TypeScript 方法重载定义的支持。

英:This rule extends the base eslint/no-dupe-class-members rule. It adds support for TypeScript's method overload definitions.


module.exports = {
"rules": {
// Note: you must disable the base rule as it can report incorrect errors
"no-dupe-class-members": "off",
"@typescript-eslint/no-dupe-class-members": "error"
在线运行试试这个规则 ↗


参见 eslint/no-dupe-class-members 选项


摘自 ❤️ ESLint 内核