Skip to content
This repository was archived by the owner on Oct 16, 2024. It is now read-only.
This repository was 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

@ST-DDT

Description

@ST-DDT

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions