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.
internalError: Error running rule requirePaddingNewLineAfterVariableDeclaration: 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: elements.map is not a function
at Array.<anonymous> (C:\Temp\github\linter-jscs_GH249\node_modules\cst\src\plugins\scopes\ScopesApi.js:56:22)
at Program._emit (C:\Temp\github\linter-jscs_GH249\node_modules\cst\src\elements\types\Program.js:107:17)
at Program._addElementsToProgram (C:\Temp\github\linter-jscs_GH249\node_modules\cst\src\elements\types\Program.js:79:14)
at Program.replaceChildren (C:\Temp\github\linter-jscs_GH249\node_modules\cst\src\elements\Element.js:518:26)
at Program.replaceChild (C:\Temp\github\linter-jscs_GH249\node_modules\cst\src\elements\Element.js:571:14)
at Object.JsFile.setWhitespaceBefore (C:\Temp\github\linter-jscs_GH249\node_modules\jscs\lib\js-file.js:110:37)
at TokenAssert._updateWhitespaceByLine (C:\Temp\github\linter-jscs_GH249\node_modules\jscs\lib\token-assert.js:174:16)
at TokenAssert._augmentLineCount (C:\Temp\github\linter-jscs_GH249\node_modules\jscs\lib\token-assert.js:364:10)
at TokenAssert.<anonymous> (C:\Temp\github\linter-jscs_GH249\node_modules\jscs\lib\token-assert.js:284:18)
at TokenAssert.linesBetween (C:\Temp\github\linter-jscs_GH249\node_modules\jscs\lib\token-assert.js:296:9)
It seems the issue with requirePaddingNewLineAfterVariableDeclaration is causing the code issue reported by disallowUnusedParams to be reported on the wrong line:
I'm assuming that the root cause is the same as this one since it requires the requirePaddingNewLineAfterVariableDeclaration rule as well, but if you want this filed as a separate bug just let me know.
* Slightly changes token-assert API by providing result of the check
with return values
* Apply fixes only in fix mode
* Modify couple rules to adjust to new strategy
* Make "fixed" property of the Error instance consistent
* Introduce "fix" property of the Error class
* Divide fix behaviour on "common" and "specific" actions
Consequently should speed up linting
Fixesjscs-dev#2250
* Slightly changes token-assert API by providing result of the check
with return values
* Apply fixes only in fix mode
* Modify couple rules to adjust to new strategy
* Make "fixed" property of the Error instance consistent
* Introduce "fix" property of the Error class
* Divide fix behaviour on "common" and "specific" actions
Consequently should speed up linting
Fixes#2250
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When running
jscs
v3.0.3 against this file:foo.js
:With this configuration:
.jshintrc
:I get the following error in the output:
It seems the issue with
![image](https://cloud.githubusercontent.com/assets/427137/15298768/e928e938-1b55-11e6-8fae-d97be7608026.png)
requirePaddingNewLineAfterVariableDeclaration
is causing the code issue reported bydisallowUnusedParams
to be reported on the wrong line:A folder with a minimal reproduction case is included here: linter-jscs_GH249-1.zip
If there is any further information you need just let me know.
Note that this was initially filed here.
The text was updated successfully, but these errors were encountered: