You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.
TypeError: Cannot read property 'replace' of undefined
at renderLine (C:\Temp\github\linter-jscs_GH239\node_modules\jscs\lib\errors.js:266:16)
at Object.Errors.explainError (C:\Temp\github\linter-jscs_GH239\node_modules\jscs\lib\errors.js:197:13)
at C:\Temp\github\linter-jscs_GH239\node_modules\jscs\lib\reporters\console.js:16:36
at Array.forEach (native)
at C:\Temp\github\linter-jscs_GH239\node_modules\jscs\lib\reporters\console.js:14:35
at Array.forEach (native)
at Object.module.exports [as writer] (C:\Temp\github\linter-jscs_GH239\node_modules\jscs\lib\reporters\console.js:9:22)
at C:\Temp\github\linter-jscs_GH239\node_modules\jscs\lib\cli.js:149:18
at Array.<anonymous> (C:\Temp\github\linter-jscs_GH239\node_modules\vow\lib\vow.js:712:56)
at Immediate.callFns [as _onImmediate] (C:\Temp\github\linter-jscs_GH239\node_modules\vow\lib\vow.js:23:35)
If the reporter is changed to JSON, it seems to be incrementing the line value for every element?
{".\\foo.js":[{"line":1,"column":12,"message":"validateNewlineAfterArrayElements: First element should be placed on new line"},{"line":2,"column":3,"message":"validateNewlineAfterArrayElements: Multiple elements at a single line in multiline array"},{"line":3,"column":4,"message":"validateNewlineAfterArrayElements: Multiple elements at a single line in multiline array"},{"line":4,"column":4,"message":"validateNewlineAfterArrayElements: Multiple elements at a single line in multiline array"},{"line":5,"column":4,"message":"validateNewlineAfterArrayElements: Multiple elements at a single line in multiline array"},{"line":6,"column":4,"message":"validateNewlineAfterArrayElements: Multiple elements at a single line in multiline array"},{"line":7,"column":3,"message":"validateNewlineAfterArrayElements: Closing bracket should be placed on new line"}]}
Using the Node API (Inside the linter-jscs Atom package) returns results similar to the JSON output. Note that this was initially filed here
I'm new to this codebase, but I've been digging into it, trying to figure this out. I'm not exactly sure what's going on. At the moment, I think it has something to do with TokenIndex._buildIndex which is where the __loc gets assigned to each token. (Those __loc values are the first time I can see erroneous line numbers show up in the output.) I'm just dropping console.logs in the source, not sure if there's a better way to track this down.
When running
jscs
v3.0.3 against this file:foo.js
:With this configuration:
.jshintrc
:I get the following error in the output:
If the reporter is changed to JSON, it seems to be incrementing the line value for every element?
Using the Node API (Inside the
linter-jscs
Atom package) returns results similar to the JSON output. Note that this was initially filed hereA folder with a minimal reproduction case is included here: linter-jscs_GH239.zip
If there is any further information you need just let me know.
The text was updated successfully, but these errors were encountered: