-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(typescript-estree): change
source
of ExportNamedDeclaration to …
…Literal from Expression (#3763) * fix(typescript-estree): change of ExportNamedDeclaration to Literal from Expression * fix(typescript-estree): add assertion for module specifier
- Loading branch information
1 parent
5b25680
commit 7c8d88f
Showing
7 changed files
with
58 additions
and
416 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
1 change: 1 addition & 0 deletions
1
packages/shared-fixtures/fixtures/javascript/modules/invalid-export-module-specifier.src.js
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 { foo } from bar; |
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
10 changes: 10 additions & 0 deletions
10
...ipt-estree/tests/snapshots/javascript/modules/invalid-export-module-specifier.src.js.shot
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,10 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`javascript modules invalid-export-module-specifier.src 1`] = ` | ||
TSError { | ||
"column": 19, | ||
"index": 19, | ||
"lineNumber": 1, | ||
"message": "Module specifier must be a string literal.", | ||
} | ||
`; |
190 changes: 5 additions & 185 deletions
190
...ee/tests/snapshots/javascript/modules/invalid-import-default-module-specifier.src.js.shot
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 |
---|---|---|
@@ -1,190 +1,10 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`javascript modules invalid-import-default-module-specifier.src 1`] = ` | ||
Object { | ||
"body": Array [ | ||
Object { | ||
"importKind": "value", | ||
"loc": Object { | ||
"end": Object { | ||
"column": 20, | ||
"line": 1, | ||
}, | ||
"start": Object { | ||
"column": 0, | ||
"line": 1, | ||
}, | ||
}, | ||
"range": Array [ | ||
0, | ||
20, | ||
], | ||
"source": Object { | ||
"loc": Object { | ||
"end": Object { | ||
"column": 19, | ||
"line": 1, | ||
}, | ||
"start": Object { | ||
"column": 16, | ||
"line": 1, | ||
}, | ||
}, | ||
"name": "bar", | ||
"range": Array [ | ||
16, | ||
19, | ||
], | ||
"type": "Identifier", | ||
}, | ||
"specifiers": Array [ | ||
Object { | ||
"loc": Object { | ||
"end": Object { | ||
"column": 10, | ||
"line": 1, | ||
}, | ||
"start": Object { | ||
"column": 7, | ||
"line": 1, | ||
}, | ||
}, | ||
"local": Object { | ||
"loc": Object { | ||
"end": Object { | ||
"column": 10, | ||
"line": 1, | ||
}, | ||
"start": Object { | ||
"column": 7, | ||
"line": 1, | ||
}, | ||
}, | ||
"name": "foo", | ||
"range": Array [ | ||
7, | ||
10, | ||
], | ||
"type": "Identifier", | ||
}, | ||
"range": Array [ | ||
7, | ||
10, | ||
], | ||
"type": "ImportDefaultSpecifier", | ||
}, | ||
], | ||
"type": "ImportDeclaration", | ||
}, | ||
], | ||
"comments": Array [], | ||
"loc": Object { | ||
"end": Object { | ||
"column": 0, | ||
"line": 2, | ||
}, | ||
"start": Object { | ||
"column": 0, | ||
"line": 1, | ||
}, | ||
}, | ||
"range": Array [ | ||
0, | ||
21, | ||
], | ||
"sourceType": "module", | ||
"tokens": Array [ | ||
Object { | ||
"loc": Object { | ||
"end": Object { | ||
"column": 6, | ||
"line": 1, | ||
}, | ||
"start": Object { | ||
"column": 0, | ||
"line": 1, | ||
}, | ||
}, | ||
"range": Array [ | ||
0, | ||
6, | ||
], | ||
"type": "Keyword", | ||
"value": "import", | ||
}, | ||
Object { | ||
"loc": Object { | ||
"end": Object { | ||
"column": 10, | ||
"line": 1, | ||
}, | ||
"start": Object { | ||
"column": 7, | ||
"line": 1, | ||
}, | ||
}, | ||
"range": Array [ | ||
7, | ||
10, | ||
], | ||
"type": "Identifier", | ||
"value": "foo", | ||
}, | ||
Object { | ||
"loc": Object { | ||
"end": Object { | ||
"column": 15, | ||
"line": 1, | ||
}, | ||
"start": Object { | ||
"column": 11, | ||
"line": 1, | ||
}, | ||
}, | ||
"range": Array [ | ||
11, | ||
15, | ||
], | ||
"type": "Identifier", | ||
"value": "from", | ||
}, | ||
Object { | ||
"loc": Object { | ||
"end": Object { | ||
"column": 19, | ||
"line": 1, | ||
}, | ||
"start": Object { | ||
"column": 16, | ||
"line": 1, | ||
}, | ||
}, | ||
"range": Array [ | ||
16, | ||
19, | ||
], | ||
"type": "Identifier", | ||
"value": "bar", | ||
}, | ||
Object { | ||
"loc": Object { | ||
"end": Object { | ||
"column": 20, | ||
"line": 1, | ||
}, | ||
"start": Object { | ||
"column": 19, | ||
"line": 1, | ||
}, | ||
}, | ||
"range": Array [ | ||
19, | ||
20, | ||
], | ||
"type": "Punctuator", | ||
"value": ";", | ||
}, | ||
], | ||
"type": "Program", | ||
TSError { | ||
"column": 15, | ||
"index": 15, | ||
"lineNumber": 1, | ||
"message": "Module specifier must be a string literal.", | ||
} | ||
`; |
Oops, something went wrong.