Skip to content

Enhance valid-track to check for clashing fields #56

@pmdartus

Description

@pmdartus

The following code should fail the valid-track rule:

class Foo {
  @track openModal = false;
  
  openModal;
  // ^ Property clashing with existing tracked fields
 
  openModal() {}
  // ^ Method clashing with existing tracked fields
}

Notes:

  • We need to validate that valid-api and valid-wire rules are also subject to this issue where a field is shadowed by another field or method with the same name.
  • This check should be added behind a flag (prior art: feat: add rule for properties containing both underscores and uppercase charactacters #54) because those rules run whenever a component is published to the Salesforce platform. Without a flag might cause LWC components not being able to the re-published.

Metadata

Metadata

Assignees

No one assigned

    Labels

    USER STORYkind/featureCategorizes issue or PR as related to a new feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions