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

capitalized-comments causes eslint to terminate with error on comment with just a space #7663

Closed
Trott opened this issue Nov 26, 2016 · 1 comment
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 patch candidate This issue may necessitate a patch release in the next few days rule Relates to ESLint's core rules

Comments

@Trott
Copy link
Contributor

Trott commented Nov 26, 2016

Tell us about your environment

  • **ESLint Version: 3.11.0
  • **Node Version: 7.2.0
  • **npm Version: 3.10.9

What parser (default, Babel-ESLint, etc.) are you using?
default

Please show your full configuration:

No configuration file.





What did you do? Please include the actual source code causing the issue.

With this file:

// 

Note that there is a single space after the //.

I ran: eslint --rule 'capitalized-comments: 2'

What did you expect to happen?
Expected lint to be successful.

What actually happened? Please include the actual, raw output from ESLint.

Cannot read property 'toLocaleLowerCase' of undefined
TypeError: Cannot read property 'toLocaleLowerCase' of undefined
    at isCommentValid (/Users/trott/.nvm/versions/node/v7.2.0/lib/node_modules/eslint/lib/rules/capitalized-comments.js:242:64)
    at processComment (/Users/trott/.nvm/versions/node/v7.2.0/lib/node_modules/eslint/lib/rules/capitalized-comments.js:262:32)
    at Array.forEach (native)
    at EventEmitter.Program (/Users/trott/.nvm/versions/node/v7.2.0/lib/node_modules/eslint/lib/rules/capitalized-comments.js:287:26)
    at emitOne (events.js:96:13)
    at EventEmitter.emit (events.js:188:7)
    at NodeEventGenerator.enterNode (/Users/trott/.nvm/versions/node/v7.2.0/lib/node_modules/eslint/lib/util/node-event-generator.js:40:22)
    at CodePathAnalyzer.enterNode (/Users/trott/.nvm/versions/node/v7.2.0/lib/node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js:608:23)
    at CommentEventGenerator.enterNode (/Users/trott/.nvm/versions/node/v7.2.0/lib/node_modules/eslint/lib/util/comment-event-generator.js:97:23)
    at Controller.enter (/Users/trott/.nvm/versions/node/v7.2.0/lib/node_modules/eslint/lib/eslint.js:925:36)
@eslintbot eslintbot added the triage An ESLint team member will look at this issue soon label Nov 26, 2016
@not-an-aardvark not-an-aardvark added accepted There is consensus among the team that this change meets the criteria for inclusion bug ESLint is working incorrectly rule Relates to ESLint's core rules and removed triage An ESLint team member will look at this issue soon labels Nov 26, 2016
@not-an-aardvark
Copy link
Member

I can reproduce this, thanks for reporting.

Trott added a commit to Trott/eslint that referenced this issue Nov 26, 2016
Fix issue where comments containing a single space would cause eslint to
terminate with a TypeError.
Trott added a commit to Trott/eslint that referenced this issue Nov 26, 2016
Fix issue where comments containing a single space would cause eslint to
terminate with a TypeError.
Trott added a commit to Trott/eslint that referenced this issue Nov 26, 2016
Fix issue where comments containing a single space would cause eslint to
terminate with a TypeError.
@not-an-aardvark not-an-aardvark added the patch candidate This issue may necessitate a patch release in the next few days label Nov 27, 2016
Trott added a commit to Trott/eslint that referenced this issue Nov 27, 2016
Fix issue where comments containing a single space would cause eslint to
terminate with a TypeError.
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 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 6, 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 patch candidate This issue may necessitate a patch release in the next few days rule Relates to ESLint's core rules
Projects
None yet
Development

No branches or pull requests

3 participants