jscs-dev / node-jscs

:arrow_heading_up: JavaScript Code Style checker (unmaintained)
https://jscs-dev.github.io
MIT License
4.97k stars 515 forks source link

Error running rule requirePaddingNewLinesBeforeLineComments #2274

Closed sharesynth closed 8 years ago

sharesynth commented 8 years ago

Received the following stack trace in terminal, messaging suggested I log this as a new issue.

Error running rule requirePaddingNewLinesBeforeLineComments: This is an issue with JSCS and not your codebase. Please file an issue (with the stack trace below) at: https://github.com/jscs-dev/node-jscs/issues/new TypeError: Cannot read property 'type' of undefined at /Users/username/projects/gradeone/math/gamename/node_modules/jscs/lib/rules/require-padding-newlines-before-line-comments.js:100:26 at /Users/username/projects/gradeone/math/gamename/node_modules/jscs/lib/js-file.js:445:17 at Array.forEach (native) at Object.JsFile.iterateTokensByType (/Users/username/projects/gradeone/math/gamename/node_modules/jscs/lib/js-file.js:443:26) at Object.module.exports.check (/Users/username/projects/gradeone/math/gamename/node_modules/jscs/lib/rules/require-padding-newlines-before-line-comments.js:86:14) at . (/Users/username/projects/gradeone/math/gamename/node_modules/jscs/lib/string-checker.js:141:22) at Array.forEach (native) at StringChecker._checkJsFile (/Users/username/projects/gradeone/math/gamename/node_modules/jscs/lib/string-checker.js:137:31) at StringChecker.checkString (/Users/username/projects/gradeone/math/gamename/node_modules/jscs/lib/string-checker.js:117:14) at . (/Users/username/projects/gradeone/math/gamename/node_modules/jscs/lib/checker.js:43:21) at src/states/level.js :

sharesynth commented 8 years ago

For anyone else that runs into this the solution is comments should not be placed above 'use strict';