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

Eslint crush when checking no-multiple-empty-lines #6484

Closed
NoamPaz opened this issue Jun 20, 2016 · 2 comments
Closed

Eslint crush when checking no-multiple-empty-lines #6484

NoamPaz opened this issue Jun 20, 2016 · 2 comments
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion

Comments

@NoamPaz
Copy link

NoamPaz commented Jun 20, 2016

C:\t2kdev\playanywhere\node_modules\gulp-eslint\node_modules\eslint\lib\rules\no-multiple-empty-lines.js:101
var length = i < fullLines.length ? fullLines[i].length : 0,
^

TypeError: Cannot read property 'length' of null
at C:\t2kdev\playanywhere\node_modules\gulp-eslint\node_modules\eslint\lib\rules\no-multiple-empty-lines.js:101:47
at Array.forEach (native)
at EventEmitter.checkBlankLines (C:\t2kdev\playanywhere\node_modules\gulp-eslint\node_modules\eslint\lib\rules\no-multiple-empty-lines.js:100:23)
at emitOne (events.js:82:20)
at EventEmitter.emit (events.js:169:7)
at NodeEventGenerator.leaveNode (C:\t2kdev\playanywhere\node_modules\gulp-eslint\node_modules\eslint\lib\util\node-event-generator.js:49:22)
at CodePathAnalyzer.leaveNode (C:\t2kdev\playanywhere\node_modules\gulp-eslint\node_modules\eslint\lib\code-path-analysis\code-path-analyzer.js:627:23)
at CommentEventGenerator.leaveNode (C:\t2kdev\playanywhere\node_modules\gulp-eslint\node_modules\eslint\lib\util\comment-event-generator.js:110:23)
at Controller.traverser.traverse.leave (C:\t2kdev\playanywhere\node_modules\gulp-eslint\node_modules\eslint\lib\eslint.js:908:36)
at Controller.__execute (C:\t2kdev\playanywhere\node_modules\gulp-eslint\node_modules\eslint\node_modules\estraverse\estraverse.js:397:31)
at Controller.traverse (C:\t2kdev\playanywhere\node_modules\gulp-eslint\node_modules\eslint\node_modules\estraverse\estraverse.js:491:28)
at Controller.Traverser.controller.traverse (C:\t2kdev\playanywhere\node_modules\gulp-eslint\node_modules\eslint\lib\util\traverser.js:36:33)
at EventEmitter.module.exports.api.verify (C:\t2kdev\playanywhere\node_modules\gulp-eslint\node_modules\eslint\lib\eslint.js:902:23)
at processText (C:\t2kdev\playanywhere\node_modules\gulp-eslint\node_modules\eslint\lib\cli-engine.js:263:31)
at CLIEngine.executeOnText (C:\t2kdev\playanywhere\node_modules\gulp-eslint\node_modules\eslint\lib\cli-engine.js:761:26)
at verify (C:\t2kdev\playanywhere\node_modules\gulp-eslint\index.js:20:23)
at Transform._transform (C:\t2kdev\playanywhere\node_modules\gulp-eslint\index.js:68:18)
at Transform._read (_stream_transform.js:167:10)
at Transform._write (_stream_transform.js:155:12)
at doWrite (_stream_writable.js:301:12)
at writeOrBuffer (_stream_writable.js:287:5)
at Transform.Writable.write (stream_writable.js:215:11)
at write (C:\t2kdev\playanywhere\node_modules\gulp\node_modules\vinyl-fs\node_modules\through2\node_modules\readable-stream\lib_stream_readable.js:623:24)
at flow (C:\t2kdev\playanywhere\node_modules\gulp\node_modules\vinyl-fs\node_modules\through2\node_modules\readable-stream\lib_stream_readable.js:632:7)
at DestroyableTransform.pipeOnReadable (C:\t2kdev\playanywhere\node_modules\gulp\node_modules\vinyl-fs\node_modules\through2\node_modules\readable-stream\lib_strea
at emitNone (events.js:67:13)
at DestroyableTransform.emit (events.js:166:7)
at emitReadable
(C:\t2kdev\playanywhere\node_modules\gulp\node_modules\vinyl-fs\node_modules\through2\node_modules\readable-stream\lib_stream_readable.js:448:10)
at emitReadable (C:\t2kdev\playanywhere\node_modules\gulp\node_modules\vinyl-fs\node_modules\through2\node_modules\readable-stream\lib_stream_readable.js:444:5)

Seems like this push did the problem:
5122f73
It has regex that probably returns null and then tries to check his length

What version of ESLint are you using? 2.0.13

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

configuration:
"no-multiple-empty-lines": [ //Limit the number of empty lines between rows.
1,
{
"max": 1
}
]

@eslintbot eslintbot added the triage An ESLint team member will look at this issue soon label Jun 20, 2016
@gilligan
Copy link

I am experiencing the same problem.

Cannot read property 'length' of null
TypeError: Cannot read property 'length' of null
    at /Users/tpflug/Development/hc-react-stack-pages/node_modules/eslint/lib/rules/no-multiple-empty-lines.js:101:47
    at Array.forEach (native)
    at EventEmitter.checkBlankLines (/Users/tpflug/Development/hc-react-stack-pages/node_modules/eslint/lib/rules/no-multiple-empty-lines.js:100:23)
    at emitOne (events.js:101:20)
    at EventEmitter.emit (events.js:188:7)
    at NodeEventGenerator.leaveNode (/Users/tpflug/Development/hc-react-stack-pages/node_modules/eslint/lib/util/node-event-generator.js:49:22)
    at CodePathAnalyzer.leaveNode (/Users/tpflug/Development/hc-react-stack-pages/node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js:627:23)
    at CommentEventGenerator.leaveNode (/Users/tpflug/Development/hc-react-stack-pages/node_modules/eslint/lib/util/comment-event-generator.js:110:23)
    at Controller.traverser.traverse.leave (/Users/tpflug/Development/hc-react-stack-pages/node_modules/eslint/lib/eslint.js:908:36)
  • version: eslint 2.13.0
  • config: baseConfig.json
  • expected: linting should work fine just like before the upgrade to 2.13.0
  • actual: Linting crashes with trace shown above

@vitorbal vitorbal added bug ESLint is working incorrectly evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion and removed triage An ESLint team member will look at this issue soon labels Jun 20, 2016
@vitorbal
Copy link
Member

Thanks guys! Seems like this is already fixed by #6449. We are planning on doing a patch-release today and this should be part of that release.

@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
archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion
Projects
None yet
Development

No branches or pull requests

4 participants