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

no-unused-vars crashes on global comments #3714

Closed
ilyavolodin opened this issue Sep 9, 2015 · 1 comment
Closed

no-unused-vars crashes on global comments #3714

ilyavolodin opened this issue Sep 9, 2015 · 1 comment
Assignees
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly rule Relates to ESLint's core rules

Comments

@ilyavolodin
Copy link
Member

Found this issue with the latest code added 5 days and not released yet). The following code:

/* global angular: true,
  $LocalProvider,
  $SomeOtherCrap
*/

var a = $LocalProvider;

will crash no-unused-vars with the following message:

c:\Users\Ilya\Documents\github\eslint\lib\rules\no-unused-vars.js:248
        var column = namePattern.exec(content).index;
                                              ^
TypeError: Cannot read property 'index' of null
    at getLocation (c:\Users\Ilya\Documents\github\eslint\lib\rules\no-unused-vars.js:248:47)
    at EventEmitter.Program:exit (c:\Users\Ilya\Documents\github\eslint\lib\rules\no-unused-vars.js:281:49)
    at EventEmitter.emit (events.js:117:20)
    at Controller.controller.traverse.leave (c:\Users\Ilya\Documents\github\eslint\lib\eslint.js:835:25)
    at Controller.__execute (c:\Users\Ilya\Documents\github\eslint\node_modules\estraverse\estraverse.js:397:31)
    at Controller.traverse (c:\Users\Ilya\Documents\github\eslint\node_modules\estraverse\estraverse.js:485:28)
    at EventEmitter.module.exports.api.verify (c:\Users\Ilya\Documents\github\eslint\lib\eslint.js:820:24)
    at processText (c:\Users\Ilya\Documents\github\eslint\lib\cli-engine.js:206:27)
    at processFile (c:\Users\Ilya\Documents\github\eslint\lib\cli-engine.js:231:12)
    at executeOnFile (c:\Users\Ilya\Documents\github\eslint\lib\cli-engine.js:499:23)

CC @mysticatea

@ilyavolodin ilyavolodin added bug ESLint is working incorrectly rule Relates to ESLint's core rules accepted There is consensus among the team that this change meets the criteria for inclusion labels Sep 9, 2015
@mysticatea
Copy link
Member

Thank you for the report, I will invest and fix this.

@mysticatea mysticatea self-assigned this Sep 10, 2015
mysticatea added a commit to mysticatea/eslint that referenced this issue Sep 10, 2015
mysticatea added a commit to mysticatea/eslint that referenced this issue Sep 10, 2015
mysticatea added a commit to mysticatea/eslint that referenced this issue Sep 10, 2015
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 7, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly rule Relates to ESLint's core rules
Projects
None yet
Development

No branches or pull requests

2 participants