diff --git a/demos/javascript/double-import.js b/demos/javascript/double-import.js index 08a47b3a3..42a04705b 100644 --- a/demos/javascript/double-import.js +++ b/demos/javascript/double-import.js @@ -1,4 +1,5 @@ import {value} from "./a.js" +import {value} from "./a.js" var foo =3 diff --git a/src/external/eslint/eslint-lint.js b/src/external/eslint/eslint-lint.js index da434c192..16cfa72c2 100644 --- a/src/external/eslint/eslint-lint.js +++ b/src/external/eslint/eslint-lint.js @@ -343,7 +343,7 @@ import {parse} from "./eslint-parser.js"; var error = errors[i]; result.push({message: error.message, severity: getSeverity(error), - from: getPos(error, true), + from: getPos(error, true) , to: getPos(error, false)}); } return result; @@ -352,6 +352,8 @@ import {parse} from "./eslint-parser.js"; CodeMirror.registerHelper("lint", "javascript", validator); function getPos(error, from) { + if (error.line === undefined) return CodeMirror.Pos(0, 0) + var line = error.line-1, ch = from ? error.column : error.column+1; if (error.node && error.node.loc) { line = from ? error.node.loc.start.line -1 : error.node.loc.end.line -1;