Skip to content

Commit

Permalink
refactor: update static getter declaration
Browse files Browse the repository at this point in the history
Use a `static get` instead of the `<class>.formAssociated` syntax based on PR feedback.
  • Loading branch information
DukeFerdinand committed Dec 30, 2024
1 parent e5176bd commit 3bc3341
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/auro-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ export class AuroButton extends LitElement {
// MDN link: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/attachInternals
// static formAssociated = true;

// this static getter does the same thing as the commented out line above
// but is compatible with our current eslint rules
static get formAssociated() {
return true;
}

constructor() {
super();

Expand Down Expand Up @@ -266,7 +272,3 @@ export class AuroButton extends LitElement {
`;
}
}

// This is for compatibility with the old version of static properties
// I REALLY want to use `static formAssociated = true;` but eslint doesn't like it
AuroButton.formAssociated = true;

0 comments on commit 3bc3341

Please sign in to comment.