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
[no-unused-vars] Incorrect code location when self referencing #13546
Comments
Thanks for the report. Actually this is intended behavior. More info #13181 |
OK but it doesn't make sense to me... In #13181, I think the error should be reported at the In my case, The I can make it like this:
So that line 3 is no longer a declaration. |
@Zodiase I agree that reporting the last assignment would make sense. We've gone through a few iterations of the reported location at this point, so we'd want to make sure we have really ironed out what it is we want if we want to consider changing it again. |
If these issues keep coming back with the other location being proposed, I think how about making the reporting location as an option? |
I agree that it would make more sense to report |
@anikethsaha I'd prefer not to go down that route, as that opens up a whole new can of words around configuration. I would also argue that this is a stylistic choice. I do think it makes the most sense to report the last assignment, however, and not the last occurrence. |
Unfortunately, it looks like there wasn't enough interest from the team Thanks for contributing to ESLint and we appreciate your understanding. |
BTW, typescript-eslint/typescript-eslint#2353 (comment) pointed me here.
Tell us about your environment
Node version: v10.20.0
npm version: v6.14.4
Local ESLint version: v7.5.0 (Currently used)
Global ESLint version: Not found
What parser (default, Babel-ESLint, etc.) are you using?
@typescript-eslint/parser
.Please show your full configuration:
Configuration
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
What did you expect to happen?
The
foobar
on line 1 should be labeled as not used.What actually happened? Please include the actual, raw output from ESLint.
Are you willing to submit a pull request to fix this bug?
Sorry but my boss is already going to kill me for wasting time on things like this (reporting bugs).
The text was updated successfully, but these errors were encountered: