Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Variables in deconstructors that match a deprecated property name are incorrectly reported as deprecated #75

Open
ST-DDT opened this issue Nov 6, 2023 · 0 comments

Comments

@ST-DDT
Copy link

ST-DDT commented Nov 6, 2023

The second required disable comment shouldn't be needed/the lint error is reported incorrectly.

function demo(
  options: {
    /**
     * @deprecated
     */
    deprecated?: boolean;
    replacement?: boolean;
  } = {}
): boolean {
  const {
    // eslint-disable-next-line deprecation/deprecation
    deprecated = false,
    // eslint-disable-next-line deprecation/deprecation
    replacement = deprecated,
  } = options;
  return replacement;
}

As you can see VSCode's code highlighting shows that the second line is not deprecated/striked-through:

grafik

Because it references a local variable instead of the deprecated property.


The first disable comment is expected/required as per #74.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant