no-dupe-class-members
NOTE: this rule is part of the
recommended
rule set.Enable full set in
deno.json
:{ "lint": { "rules": { "tags": ["recommended"] } } }
Enable full set using the Deno CLI:
deno lint --rules-tags=recommended
This rule can be explictly included to or excluded from the rules present in the current tag by adding it to the
include
or exclude
array in deno.json
:{ "lint": { "rules": { "include": ["no-dupe-class-members"], "exclude": ["no-dupe-class-members"] } } }
Disallows using a class member function name more than once.
Declaring a function of the same name twice in a class will cause the previous declaration(s) to be overwritten, causing unexpected behaviors.
Invalid:
class Foo {
bar() {}
bar() {}
}
Valid:
class Foo {
bar() {}
fizz() {}
}