lwc icon indicating copy to clipboard operation
lwc copied to clipboard

Warn on duplicate getters/setters/props/methods

Open nolanlawson opened this issue 1 year ago • 1 comments

Step 1 of https://github.com/salesforce/lwc/issues/4450 is to have compile-time warnings for duplicate getters/setters/props/methods:

class Component extends LightningElement {
  get book1 () {}
  set book2(v) {}
  book
  book() {}
}

You can have 1) a method, you can have 2) a prop, you can have 3) a getter/setter (either/both), but you can't have two from the three different categories. We should warn on this.

We could presumably do this for all objects, but to avoid boiling the ocean, let's just focus on LightningElements (or assumed LightningElements). This is important for us because of how registerDecorators works in particular.

nolanlawson avatar Dec 10 '24 19:12 nolanlawson

This issue has been linked to a new work item: W-17406487

git2gus[bot] avatar Dec 10 '24 19:12 git2gus[bot]