Duplicate name 'unit'
21 return this.data.data;
22 }
23
24 get unit() {25 console.log(this.unit);26 }27
28 static get ["staticNum"]() {
29 const staticData = { ...this.staticData };
Description
If there are multiple declarations of the same name in class members, the last declaration overwrites other declarations silently. It can cause unexpected behavior.
Bad Practice
class Foo {
bar() { console.log("hello"); }
bar() { console.log("goodbye"); }
}
var foo = new Foo();
foo.bar(); // goodbye
Recommended
class Foo {
bar() { console.log("Hello"); }
baz() { console.log("goodbye"); }
}