-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[no-dupe-class-members] false negative for method overload #291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
class Foo {
bar() {}
bar() {} // Error: Duplicate function implementation.
} So |
Thank you for the report. I think that we should have the setting to disable {
"overrides": [
{
"files": ["*.ts", "*.tsx"],
"rules": {
"no-dupe-class-members": "off"
}
}
]
} And we should not have any alternative rule since |
I’m not fond of the idea of merely relying on tsc compiler errors. Sometimes I’m using babel to compile typescript and it would be nice to be notified of dupe class members anyways. |
Just to note, your test is not the same as OP You have actually wrote two implementations, where as the OP as an single implementations with 2 overrides. |
Uh oh!
There was an error while loading. Please reload this page.
Repro
Expected Result
no errors
Actual Result
Additional Info
no-dupe-class-members is a recommended rule in eslint, so many users enable it.
My suggestions:
A. disable in
plugin:@typescript-eslint/recommended
B. create
@typescript-eslint/no-dupe-class-members
and add an option to allow overload in TypeScriptC. notice in document
Versions
@typescript-eslint/eslint-plugin
1.3.0
@typescript-eslint/parser
1.3.0
TypeScript
3.3.3
ESLint
5.14.0
node
10.15.1
npm
6.8.0
The text was updated successfully, but these errors were encountered: