Recognize that variables/getters are being used when referenced in a wire via "$propertyName"

Issue #2102 resolved
Darrion created an issue

Steps to reproduce:

Create an LWC

Create a getter and a class property:

get firstName(){return 'test';}
lastName;

Create a wired function, which references the getter/property:

@wire(someApexMethod, {fName: "$firstName", lName: "$lastName"})
fetchDetailsByFirstAndLastName({error, data}){// logic}

Note that the linter will mark firstName / lastName as being unused, and recommend removal, as it does not recognize the usage of the properties in the “$property” wire syntax.

Comments (1)

  1. Scott Wells repo owner

    Delivered in 2.2.2.0:

    Added support for code completion and references for $fieldOrPropertyName expressions in wire decorator configuration string literals. Note, however, that completions and references are not currently supported for expression variants (i.e., chained expressions after dots), only for the first expression.

  2. Log in to comment