Error Thrown: Line number out of range
See original GitHub issueTell us about your environment
- ESLint Version: 3.19.0
- Node Version: 7.7.3
- npm Version: 4.4.4
What parser (default, Babel-ESLint, etc.) are you using? default
Please show your full configuration:
module.exports = {
"extends": "standard",
"plugins": [
"standard",
"promise"
]
};
What did you do? Please include the actual source code causing the issue.
eslint --fix */**
What did you expect to happen? Successful execution.
What actually happened? Please include the actual, raw output from ESLint.
Line number out of range (line 318 requested, but only 317 lines present).
RangeError: Line number out of range (line 318 requested, but only 317 lines present).
at SourceCode.getIndexFromLoc (/usr/local/lib/node_modules/eslint/lib/util/source-code.js:389:19)
at Object.fix (/usr/local/lib/node_modules/eslint/lib/rules/no-multiple-empty-lines.js:116:52)
at RuleContext.report (/usr/local/lib/node_modules/eslint/lib/rule-context.js:127:34)
at Program:exit.allLines.reduce.concat.reduce (/usr/local/lib/node_modules/eslint/lib/rules/no-multiple-empty-lines.js:108:37)
at Array.reduce (native)
at EventEmitter.Program:exit (/usr/local/lib/node_modules/eslint/lib/rules/no-multiple-empty-lines.js:93:22)
at emitOne (events.js:101:20)
at EventEmitter.emit (events.js:191:7)
at NodeEventGenerator.applySelector (/usr/local/lib/node_modules/eslint/lib/util/node-event-generator.js:265:26)
at NodeEventGenerator.applySelectors (/usr/local/lib/node_modules/eslint/lib/util/node-event-generator.js:294:22)
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:7 (4 by maintainers)
Top Results From Across the Web
ESLint Error: Line number out of range - Stack Overflow
It appears that this error is consistently thrown if the file ends in a new line with a space character. When I delete...
Read more >List Index Out of Range – Python Error Message Solved
In this article you'll see a few of the reasons that cause the list index out of range Python error. Besides knowing why...
Read more >RangeError - JavaScript - MDN Web Docs
The RangeError object indicates an error when a value is not in the set or range of allowed values. Description. A RangeError is...
Read more >C# Exception Guide: ArgumentOutOfRangeException
The ArgumentOutOfRangeException exception is thrown when the value of an argument is outside the expected range of values as defined by the ...
Read more >Modern C++ best practices for exceptions and error handling
Program errors are often divided into two categories: Logic errors that are caused by programming mistakes, for example, an "index out of range" ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I can reproduce by add only two spaces at last line in any file.
Thanks for that insight, @not-an-aardvark.
It appears that this error is consistently thrown if the file ends in a new line with a space character. When I delete the space, the error goes away.
Unfortunately, this pre-existing codebase in which I’m working oddly seems to have a lot of files that end in a new line + space.