-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(es/typescript): Follow TypeScript error report (#5114)
- Loading branch information
1 parent
fa66ee8
commit f952a61
Showing
17 changed files
with
192 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"$schema": "http://json.schemastore.org/swcrc", | ||
"jsc": { | ||
"parser": { | ||
"syntax": "typescript" | ||
} | ||
}, | ||
"module": { | ||
"type": "commonjs" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default 1; | ||
|
||
export = {}; |
6 changes: 6 additions & 0 deletions
6
crates/swc/tests/errors/lints/duplicate-exports/4/output.swc-stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
x An export assignment cannot be used in a module with other exported elements. | ||
,---- | ||
3 | export = {}; | ||
: ^^^^^^^^^^^^ | ||
`---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"$schema": "http://json.schemastore.org/swcrc", | ||
"jsc": { | ||
"parser": { | ||
"syntax": "typescript" | ||
} | ||
}, | ||
"module": { | ||
"type": "commonjs" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export = 1; | ||
export = 2; | ||
export = 3; |
18 changes: 18 additions & 0 deletions
18
crates/swc/tests/errors/lints/duplicate-exports/5/output.swc-stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
x multiple `export =` found | ||
,-[1:1] | ||
1 | export = 1; | ||
: ^^^^^|^^^^^ | ||
: `-- previous `export =` declared here | ||
2 | export = 2; | ||
: ^^^^^^^^^^^ | ||
`---- | ||
|
||
x multiple `export =` found | ||
,-[2:1] | ||
2 | export = 2; | ||
: ^^^^^|^^^^^ | ||
: `-- previous `export =` declared here | ||
3 | export = 3; | ||
: ^^^^^^^^^^^ | ||
`---- |
12 changes: 12 additions & 0 deletions
12
crates/swc/tests/errors/module/esnext/export-assign/.swcrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"$schema": "http://json.schemastore.org/swcrc", | ||
"jsc": { | ||
"parser": { | ||
"syntax": "typescript" | ||
}, | ||
"target": "es2020" | ||
}, | ||
"module": { | ||
"type": "es6" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export = 42; |
6 changes: 6 additions & 0 deletions
6
crates/swc/tests/errors/module/esnext/export-assign/output.swc-stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
x Export assignment cannot be used when targeting ECMAScript modules. Consider using `export default` or another module format instead. | ||
,---- | ||
1 | export = 42; | ||
: ^^^^^^^^^^^^ | ||
`---- |
12 changes: 12 additions & 0 deletions
12
crates/swc/tests/errors/module/esnext/import-assign/.swcrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"$schema": "http://json.schemastore.org/swcrc", | ||
"jsc": { | ||
"parser": { | ||
"syntax": "typescript" | ||
}, | ||
"target": "es2020" | ||
}, | ||
"module": { | ||
"type": "es6" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import homura = require("homura"); | ||
|
||
export import madoka = require("madoka"); |
12 changes: 12 additions & 0 deletions
12
crates/swc/tests/errors/module/esnext/import-assign/output.swc-stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
x Import assignment cannot be used when targeting ECMAScript modules. Consider using `import * as ns from "mod"`, `import {a} from "mod"`, `import d from "mod"`, or another module format instead. | ||
,---- | ||
1 | import homura = require("homura"); | ||
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
`---- | ||
|
||
x Import assignment cannot be used when targeting ECMAScript modules. Consider using `import * as ns from "mod"`, `import {a} from "mod"`, `import d from "mod"`, or another module format instead. | ||
,---- | ||
3 | export import madoka = require("madoka"); | ||
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
`---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f952a61
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Benchmark
es/full/minify/libraries/antd
1786169866
ns/iter (± 114204135
)1758186947
ns/iter (± 68279867
)1.02
es/full/minify/libraries/d3
446747396
ns/iter (± 37105310
)462142462
ns/iter (± 25284067
)0.97
es/full/minify/libraries/echarts
1771580421
ns/iter (± 154631986
)1757346507
ns/iter (± 115085655
)1.01
es/full/minify/libraries/jquery
109026497
ns/iter (± 12684919
)113878937
ns/iter (± 8570440
)0.96
es/full/minify/libraries/lodash
144098234
ns/iter (± 24390314
)143956466
ns/iter (± 9064548
)1.00
es/full/minify/libraries/moment
63348313
ns/iter (± 2143507
)62069206
ns/iter (± 4302931
)1.02
es/full/minify/libraries/react
20510033
ns/iter (± 4704088
)20700405
ns/iter (± 4261479
)0.99
es/full/minify/libraries/terser
649541915
ns/iter (± 43724176
)641719397
ns/iter (± 51612064
)1.01
es/full/minify/libraries/three
612941308
ns/iter (± 98882614
)566688370
ns/iter (± 47401752
)1.08
es/full/minify/libraries/typescript
3806066704
ns/iter (± 253310375
)3754294522
ns/iter (± 133172812
)1.01
es/full/minify/libraries/victory
782409336
ns/iter (± 93927600
)776367455
ns/iter (± 48976443
)1.01
es/full/minify/libraries/vue
169646197
ns/iter (± 3503812
)134794816
ns/iter (± 5204243
)1.26
es/full/codegen/es3
33785
ns/iter (± 3313
)32501
ns/iter (± 1482
)1.04
es/full/codegen/es5
33206
ns/iter (± 1961
)32199
ns/iter (± 488
)1.03
es/full/codegen/es2015
33757
ns/iter (± 1810
)32293
ns/iter (± 1207
)1.05
es/full/codegen/es2016
32308
ns/iter (± 440
)32415
ns/iter (± 2238
)1.00
es/full/codegen/es2017
32349
ns/iter (± 631
)32441
ns/iter (± 1463
)1.00
es/full/codegen/es2018
32363
ns/iter (± 1679
)32372
ns/iter (± 1194
)1.00
es/full/codegen/es2019
32393
ns/iter (± 2240
)32288
ns/iter (± 1363
)1.00
es/full/codegen/es2020
32562
ns/iter (± 1168
)32009
ns/iter (± 573
)1.02
es/full/all/es3
211461222
ns/iter (± 15372153
)190552070
ns/iter (± 13749926
)1.11
es/full/all/es5
199556462
ns/iter (± 13351772
)169022391
ns/iter (± 6954254
)1.18
es/full/all/es2015
153561301
ns/iter (± 11863103
)141433629
ns/iter (± 9119774
)1.09
es/full/all/es2016
147012169
ns/iter (± 16109374
)137862944
ns/iter (± 3938258
)1.07
es/full/all/es2017
149891256
ns/iter (± 11582520
)152248735
ns/iter (± 15489252
)0.98
es/full/all/es2018
145951194
ns/iter (± 13584130
)141493556
ns/iter (± 11115415
)1.03
es/full/all/es2019
153206771
ns/iter (± 13002580
)134962649
ns/iter (± 5065972
)1.14
es/full/all/es2020
145877834
ns/iter (± 13970615
)132009184
ns/iter (± 6439143
)1.11
es/full/parser
718437
ns/iter (± 33157
)708755
ns/iter (± 22784
)1.01
es/full/base/fixer
29593
ns/iter (± 8246
)29651
ns/iter (± 553
)1.00
es/full/base/resolver_and_hygiene
88694
ns/iter (± 8881
)88205
ns/iter (± 1764
)1.01
serialization of ast node
217
ns/iter (± 10
)214
ns/iter (± 2
)1.01
serialization of serde
228
ns/iter (± 5
)227
ns/iter (± 1
)1.00
This comment was automatically generated by workflow using github-action-benchmark.