Skip to content

Commit

Permalink
Add id field to esbuild messages
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Jul 24, 2022
1 parent 7f37b95 commit 7d8dc11
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
1 change: 1 addition & 0 deletions packages/esbuild/lib/index.js
Expand Up @@ -198,6 +198,7 @@ export function esbuild(options = {}) {

;(!('fatal' in message) || message.fatal ? errors : warnings).push({
pluginName: name,
id: '',
text:
'reason' in message
? message.reason
Expand Down
31 changes: 20 additions & 11 deletions packages/esbuild/test/index.test.js
Expand Up @@ -209,9 +209,10 @@ test('@mdx-js/esbuild', async () => {
},
notes: [],
pluginName: '@mdx-js/esbuild',
text: 'Unexpected character `/` (U+002F) before local name, expected a character that can start a name, such as a letter, `$`, or `_` (note: to create a link in MDX, use `[text](url)`)'
text: 'Unexpected character `/` (U+002F) before local name, expected a character that can start a name, such as a letter, `$`, or `_` (note: to create a link in MDX, use `[text](url)`)',
id: ''
},
'should pass errors'
'should pass errors (1)'
)
}

Expand Down Expand Up @@ -288,7 +289,8 @@ test('@mdx-js/esbuild', async () => {
},
notes: [],
pluginName: '@mdx-js/esbuild',
text: '7'
text: '7',
id: ''
}
],
warnings: [
Expand All @@ -304,7 +306,8 @@ test('@mdx-js/esbuild', async () => {
},
notes: [],
pluginName: '@mdx-js/esbuild',
text: '1'
text: '1',
id: ''
},
{
location: {
Expand All @@ -318,7 +321,8 @@ test('@mdx-js/esbuild', async () => {
},
notes: [],
pluginName: '@mdx-js/esbuild',
text: '2'
text: '2',
id: ''
},
{
location: {
Expand All @@ -332,7 +336,8 @@ test('@mdx-js/esbuild', async () => {
},
notes: [],
pluginName: '@mdx-js/esbuild',
text: '3'
text: '3',
id: ''
},
{
location: {
Expand All @@ -346,7 +351,8 @@ test('@mdx-js/esbuild', async () => {
},
notes: [],
pluginName: '@mdx-js/esbuild',
text: '4'
text: '4',
id: ''
},
{
location: {
Expand All @@ -360,7 +366,8 @@ test('@mdx-js/esbuild', async () => {
},
notes: [],
pluginName: '@mdx-js/esbuild',
text: '5'
text: '5',
id: ''
},
{
location: {
Expand All @@ -374,7 +381,8 @@ test('@mdx-js/esbuild', async () => {
},
notes: [],
pluginName: '@mdx-js/esbuild',
text: '6'
text: '6',
id: ''
}
]
},
Expand Down Expand Up @@ -436,12 +444,13 @@ test('@mdx-js/esbuild', async () => {
},
notes: [],
pluginName: '@mdx-js/esbuild',
text: 'Error: Something went wrong'
text: 'Error: Something went wrong',
id: ''
}
],
warnings: []
},
'should pass errors'
'should pass errors (2)'
)
}

Expand Down

0 comments on commit 7d8dc11

Please sign in to comment.