Skip to content
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

Wrong position reported for unused destructuring parameters #2494

Closed
nicolo-ribaudo opened this issue Jun 28, 2015 · 1 comment
Closed

Wrong position reported for unused destructuring parameters #2494

nicolo-ribaudo opened this issue Jun 28, 2015 · 1 comment
Assignees

Comments

@nicolo-ribaudo
Copy link
Contributor

This works in JSHint 2.8.0, but not in master.

//jshint esnext: true, unused: true
function fn({ x }) {}
$ bin/jshint test.js
test.js: line 0, col 0, 'x' is defined but never used.
test.js: line 2, col 10, 'fn' is defined but never used.

2 errors

Expected:

test.js: line 2, col 10, 'fn' is defined but never used.
test.js: line 2, col 15, 'x' is defined but never used.
@lukeapage
Copy link
Member

It will be the token used in functionparams destructuring i bet. Ive made a pr altering functionparams, will fix this tomorrow on top of that to avoid conflicts. Thanks for finding this.

@lukeapage lukeapage self-assigned this Jun 28, 2015
lukeapage added a commit to lukeapage/jshint that referenced this issue Jun 29, 2015
The extract to scope manager change introduced a regression where by
destructured params did not get the right line and char due to the token
not being passed to the scope manager.
Fixes jshint#2494
lukeapage added a commit to lukeapage/jshint that referenced this issue Jun 29, 2015
The extract to scope manager change introduced a regression where by
destructured params did not get the right line and char due to the token
not being passed to the scope manager.
Fixes jshint#2494
lukeapage added a commit to lukeapage/jshint that referenced this issue Jul 5, 2015
The extract to scope manager change introduced a regression where by
destructured params did not get the right line and char due to the token
not being passed to the scope manager.
Fixes jshint#2494
lukeapage added a commit to lukeapage/jshint that referenced this issue Jul 5, 2015
The extract to scope manager change introduced a regression where by
destructured params did not get the right line and char due to the token
not being passed to the scope manager.
Fixes jshint#2494
lukeapage added a commit to lukeapage/jshint that referenced this issue Jul 13, 2015
The extract to scope manager change introduced a regression where by
destructured params did not get the right line and char due to the token
not being passed to the scope manager.
Fixes jshint#2494
jugglinmike pushed a commit to jugglinmike/jshint that referenced this issue Jul 19, 2015
The extract to scope manager change introduced a regression where by
destructured params did not get the right line and char due to the token
not being passed to the scope manager.
Fixes jshint#2494
jugglinmike pushed a commit to jugglinmike/jshint that referenced this issue Sep 20, 2015
The extract to scope manager change introduced a regression where by
destructured params did not get the right line and char due to the token
not being passed to the scope manager.
Fixes jshint#2494
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants