File tree 2 files changed +3
-3
lines changed
2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ export function isSwcError(error: unknown): error is SwcError {
16
16
17
17
// Since swc throw an object, we need to wrap it in a proper error
18
18
export function wrapAndReThrowSwcError ( error : SwcError ) : never {
19
- const errorHints = `${ error . filename } :${ error . startLine } ${ error . snippet } ` ;
19
+ const errorHints = `${ error . filename } :${ error . startLine } \n ${ error . snippet } \n ` ;
20
20
switch ( error . code ) {
21
21
case "UnsupportedSyntax" : {
22
22
const unsupportedSyntaxError = new Error ( error . message ) ;
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ exports[`should have proper error code 1`] = `
2
2
{
3
3
"code": "UnsupportedSyntax",
4
4
"message": "\`module\` keyword is not supported. Use \`namespace\` instead.",
5
- "snippet": " \\n \\n module F { export type x = number }\\n ^^^^^^^^\\n \\n",
5
+ "snippet": "module F { export type x = number }\\n^^^^^^^^\\n",
6
6
"filename": "<anon>",
7
7
"startLine": 1,
8
8
"startColumn": 0,
@@ -15,7 +15,7 @@ exports[`should have proper error code 2`] = `
15
15
{
16
16
"code": "InvalidSyntax",
17
17
"message": "'const' declarations must be initialized",
18
- "snippet": " \\n \\n const foo;\\n ^^^\\n \\n",
18
+ "snippet": "const foo;\\n ^^^\\n",
19
19
"filename": "<anon>",
20
20
"startLine": 1,
21
21
"startColumn": 6,
You can’t perform that action at this time.
0 commit comments