Skip to content

Bug: [no-unused-vars] False negative when var is referenced from TSDoc {@link ...} / tsdoc support #6967

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
4 tasks done
kraenhansen opened this issue Apr 28, 2023 · 2 comments
Labels
duplicate This issue or pull request already exists package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@kraenhansen
Copy link

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have searched for related issues and found none that matched my issue.
  • I have read the FAQ and my problem is not listed.

Playground Link

https://typescript-eslint.io/play/#ts=5.0.4&sourceType=module&code=JYWwDg9gTgLgBAbzgZQiApjAFsAdgczgF84AzKNOAcgGc10B3LdKdKgbgCgB6AKl85xecAKo10NONnSIAAgBs8AaxT1sefEUG9undAA9IsOAGN5AQxqSAwhFw0ArhiiJinIA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6Jge1tidmUQAmtAG4BDaKgyRE0aB2iRwYAL4hlQA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA

Repro Code

import { Something } from 'somewhere';
/**
 * Uses the {@link Something}
 */
export class Consumer { }

ESLint Config

module.exports = {
  parser: "@typescript-eslint/parser",
  rules: {
    "@typescript-eslint/no-unused-vars": "error"
  }
};

tsconfig

No response

Expected Result

I expected the {@link Something} to mark Something as used and therefore not fail on line 1

Actual Result

An error on line 1:

'Something' is defined but never used. 1:10 - 1:19

Additional Info

When I Ctrl + click in VSCode my editor jumps to the class definition as expected and TypeDoc will generate links when mentioning a class like this, but it must be imported.

This is a link for the {@link} inline tag: https://tsdoc.org/pages/tags/link/

@kraenhansen kraenhansen added bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for team members to take a look labels Apr 28, 2023
@kraenhansen
Copy link
Author

Related reading:

@kraenhansen
Copy link
Author

kraenhansen commented Apr 28, 2023

I did search for other issues mentioning this, but apparently not well enough as I see my issue is a duplicate of #5017, which was closed as a wontfix and reference the eslint-pligin-jsdoc issue that I did manage to find. Anyways - I'll close this again and continue in that other issue.

@Josh-Cena Josh-Cena added duplicate This issue or pull request already exists and removed bug Something isn't working triage Waiting for team members to take a look labels Apr 29, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This issue or pull request already exists package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
Development

No branches or pull requests

2 participants