Skip to content

Commit

Permalink
refactor: move "Parsing error" prefix adding to Linter (#18650)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjermanovic authored Jul 2, 2024
1 parent c8d26cb commit 9e6d640
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/languages/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ module.exports = {
} catch (ex) {

// If the message includes a leading line number, strip it:
const message = `Parsing error: ${ex.message.replace(/^line \d+:/iu, "").trim()}`;
const message = ex.message.replace(/^line \d+:/iu, "").trim();

debug("%s\n%s", message, ex.stack);

Expand Down
2 changes: 1 addition & 1 deletion lib/linter/linter.js
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,7 @@ function parse(file, language, languageOptions) {
nodeType: null,
fatal: true,
severity: 2,
message: error.message,
message: `Parsing error: ${error.message}`,
line: error.line,
column: error.column
}))
Expand Down

0 comments on commit 9e6d640

Please sign in to comment.