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

Range Error when last line contains spaces #1206

Closed
AlexHolly opened this issue Sep 27, 2018 · 2 comments

Comments

@AlexHolly
Copy link

commented Sep 27, 2018

maybe related to #1142

What version of standard?
npm install standard@10.0.3 --save-dev

What operating system, Node.js, and npm version?
Windows 7
node 10.11.0
npm 6.4.1

What did you expect to happen?
> .\node_modules\.bin\standard
standard: Use JavaScript Standard Style (https://standardjs.com)
C:\project\src\app.js:1:5: 'test' is defined but never used.

What actually happened?
> .\node_modules\.bin\standard
Second line contains tab/spaces>0

var test
  
RangeError: Line number out of range (line 3 requested, but only 2 lines present
).
    at SourceCode.getIndexFromLoc (C:\Users\...\AppData\Roaming\npm\node_m
odules\standard\node_modules\eslint\lib\util\source-code.js:389:19)
    at Object.fix (C:\Users\...\AppData\Roaming\npm\node_modules\standard\
node_modules\eslint\lib\rules\no-multiple-empty-lines.js:116:52)
    at RuleContext.report (C:\Users\...\AppData\Roaming\npm\node_modules\s
tandard\node_modules\eslint\lib\rule-context.js:127:34)
    at Program:exit.allLines.reduce.concat.reduce (C:\Users\...\AppData\Ro
aming\npm\node_modules\standard\node_modules\eslint\lib\rules\no-multiple-empty-
lines.js:108:37)
    at Array.reduce (<anonymous>)
    at EventEmitter.Program:exit (C:\Users\...\AppData\Roaming\npm\node_mo
dules\standard\node_modules\eslint\lib\rules\no-multiple-empty-lines.js:93:22)
    at EventEmitter.emit (events.js:187:15)
    at NodeEventGenerator.applySelector (C:\Users\...\AppData\Roaming\npm\
node_modules\standard\node_modules\eslint\lib\util\node-event-generator.js:265:2
6)
...
@LinusU

This comment has been minimized.

Copy link
Member

commented Sep 27, 2018

Is there a bug in ESLint about this? If not, could you report one?

@AlexHolly

This comment has been minimized.

Copy link
Author

commented Oct 15, 2018

looks fixed in version 12.0.1

@AlexHolly AlexHolly closed this Oct 15, 2018

@lock lock bot locked as resolved and limited conversation to collaborators Jan 13, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
2 participants
You can’t perform that action at this time.