1
我正在使用標準配置的ESLint。ESLint錯誤:行號超出範圍
我得到運行eslint --fix */**
當這個錯誤:
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)
任何想法如何解決這一問題?
我試圖standard --fix
首先從標準CLI,並得到了同樣的錯誤,然後直接嘗試了從ESLint以確認它是由後者引發的錯誤,而不是前者。