Skip to content

[no-unused-vars] "exported" declaration ignored for interface containing a function returning the interface itself #2782

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
3 tasks done
marekdedic opened this issue Nov 18, 2020 · 1 comment · Fixed by #2768
Labels
bug Something isn't working has pr there is a PR raised to close this package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@marekdedic
Copy link
Contributor

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have read the FAQ and my problem is not listed.

Repro

See https://gist.github.com/marekdedic/d5f1c0ef082159c9641176d367738b15 and run npm run lint

Expected Result

In the repro, I would expect to get no errors for the exported.ts file and 3 no-unused-vars errors for no-exported.ts.

Actual Result

In the repro, I get 1 error for the exported.ts file (specifically for the non-empty interface) and 3 no-unused-vars errors for no-exported.ts.

Versions

package version
@typescript-eslint/eslint-plugin 4.8.1
@typescript-eslint/parser 4.8.1
TypeScript 4.0.5
ESLint 7.13.0
node 14.15.1

Let me know if any additional info is needed ;)

@marekdedic marekdedic added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for team members to take a look labels Nov 18, 2020
@marekdedic marekdedic changed the title [no.unused-vars] "exported" declaration ignored for interface containig a function returning itself [no-unused-vars] "exported" declaration ignored for interface containig a function returning itself Nov 18, 2020
@marekdedic marekdedic changed the title [no-unused-vars] "exported" declaration ignored for interface containig a function returning itself [no-unused-vars] "exported" declaration ignored for interface containing a function returning the interface itself Nov 18, 2020
@bradzacher bradzacher added bug Something isn't working has pr there is a PR raised to close this and removed triage Waiting for team members to take a look labels Nov 18, 2020
@bradzacher bradzacher linked a pull request Nov 18, 2020 that will close this issue
@bradzacher
Copy link
Member

bradzacher commented Nov 18, 2020

This happens because currently the rule does out-of-band reporting for interfaces that reference themselves but are otherwise unused. This reporting ignores all of the base logic (like exported comments)

Will be fixed by #2768

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working has pr there is a PR raised to close this package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants