We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 534b297 commit 3048f37Copy full SHA for 3048f37
1 file changed
src/js/_enqueues/vendor/codemirror/fakejshint.js
@@ -94,15 +94,16 @@ window.JSHINT = ( () => {
94
}
95
96
/**
97
- * Converts a SyntaxError to a JSHINT error.
+ * Converts an Espree error to a JSHINT error.
98
*
99
- * @param {SyntaxError} error - SyntaxError to convert.
+ * @param {Error|SyntaxError} error - Error to convert.
100
* @return {JSHintError} JSHint error.
101
*/
102
function convertError( error ) {
103
+ // Note: A lineNumber of 0 causes CodeMirror to log out a warning in the console. This is as desired for a generic Espree error.
104
return {
- line: error.lineNumber,
105
- character: error.column,
+ line: error.lineNumber || 0,
106
+ character: error.column || 0,
107
reason: error.message,
108
code: 'E',
109
};
0 commit comments