-
-
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): Support type-only import equals declaration (#1695)
Co-authored-by: 강동윤 <kdy1997.dev@gmail.com>
- Loading branch information
Showing
180 changed files
with
434 additions
and
146 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
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
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
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
1 change: 1 addition & 0 deletions
1
ecmascript/parser/tests/typescript-errors/type-only-import-equals-decl/named/input.ts
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 @@ | ||
import type { MyType } = require('commonjs-package') |
6 changes: 6 additions & 0 deletions
6
ecmascript/parser/tests/typescript-errors/type-only-import-equals-decl/named/input.ts.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 @@ | ||
error: Expected from, got = | ||
--> $DIR/tests/typescript-errors/type-only-import-equals-decl/named/input.ts:1:24 | ||
| | ||
1 | import type { MyType } = require('commonjs-package') | ||
| ^ | ||
|
1 change: 1 addition & 0 deletions
1
ecmascript/parser/tests/typescript-errors/type-only-import-equals-decl/namespace/input.ts
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 @@ | ||
import type * as MyType = require('commonjs-package') |
6 changes: 6 additions & 0 deletions
6
...ipt/parser/tests/typescript-errors/type-only-import-equals-decl/namespace/input.ts.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 @@ | ||
error: Expected from, got = | ||
--> $DIR/tests/typescript-errors/type-only-import-equals-decl/namespace/input.ts:1:25 | ||
| | ||
1 | import type * as MyType = require('commonjs-package') | ||
| ^ | ||
|
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
1 change: 1 addition & 0 deletions
1
ecmascript/parser/tests/typescript/import/equals-type-only/input.ts
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 @@ | ||
import type MyType = require('commonjs-package') |
54 changes: 54 additions & 0 deletions
54
ecmascript/parser/tests/typescript/import/equals-type-only/input.ts.json
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,54 @@ | ||
{ | ||
"type": "Module", | ||
"span": { | ||
"start": 0, | ||
"end": 48, | ||
"ctxt": 0 | ||
}, | ||
"body": [ | ||
{ | ||
"type": "TsImportEqualsDeclaration", | ||
"span": { | ||
"start": 0, | ||
"end": 48, | ||
"ctxt": 0 | ||
}, | ||
"declare": false, | ||
"isExport": false, | ||
"isTypeOnly": true, | ||
"id": { | ||
"type": "Identifier", | ||
"span": { | ||
"start": 12, | ||
"end": 18, | ||
"ctxt": 0 | ||
}, | ||
"value": "MyType", | ||
"optional": false | ||
}, | ||
"moduleRef": { | ||
"type": "TsExternalModuleReference", | ||
"span": { | ||
"start": 21, | ||
"end": 48, | ||
"ctxt": 0 | ||
}, | ||
"expression": { | ||
"type": "StringLiteral", | ||
"span": { | ||
"start": 29, | ||
"end": 47, | ||
"ctxt": 0 | ||
}, | ||
"value": "commonjs-package", | ||
"hasEscape": false, | ||
"kind": { | ||
"type": "normal", | ||
"containsQuote": true | ||
} | ||
} | ||
} | ||
} | ||
], | ||
"interpreter": null | ||
} |
Oops, something went wrong.