Skip to content

Commit

Permalink
fix: message with newline
Browse files Browse the repository at this point in the history
  • Loading branch information
Ni55aN committed Aug 29, 2024
1 parent 43a4573 commit 0adc3bc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/lint/formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class Formatter {
}

private normalizeMessages(result: LintResult) {
const newLineRegex = /[\s\n]{2,}/g
const newLineRegex = /\s*\n\s*/g

const messages = result.messages.map(message => {
return {
Expand Down
4 changes: 2 additions & 2 deletions test/lint/formatter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ describe('Formatter', () => {
messages: [
{
...message1,
message: 'message\na\t\nb \nc'
message: 'message\na\t\nb \nc \n\td\t\n e'
}
]
}
Expand All @@ -165,7 +165,7 @@ describe('Formatter', () => {
messages: [
{
...message1,
message: 'message a b c'
message: 'message a b c d e'
}
],
errorCount: expect.any(Number),
Expand Down

0 comments on commit 0adc3bc

Please sign in to comment.