-
-
Notifications
You must be signed in to change notification settings - Fork 860
fix(semantic): missing references when export {} references a type-only binding and a normal
#7812
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
1ac03c2
fix(transform/typescript): shoudn't strip values
hyf0 ea42dfa
[autofix.ci] apply automated fixes
autofix-ci[bot] bbb486a
Fix
hyf0 3b275f5
Fix
hyf0 2a58aa9
Fix
hyf0 799265d
Update snap
hyf0 9979923
foramt comment
Dunqing 9444536
add semantic fixture test
Dunqing 52678a7
add a test in transformer
Dunqing 938b41c
update snapshots
Dunqing 9574bfa
Merge remote-tracking branch 'origin/main' into hyf_230984903
Dunqing 1f77a18
merge main
Dunqing 48b353f
Merge remote-tracking branch 'origin/main' into hyf_230984903
Dunqing 3e455e0
Merge branch 'main' into hyf_230984903
Dunqing 7b92a06
update snapshot
Dunqing File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
50 changes: 50 additions & 0 deletions
50
crates/oxc_semantic/tests/fixtures/oxc/ts/export/named/type-and-non-type.snap
This file contains hidden or 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,50 @@ | ||
| --- | ||
| source: crates/oxc_semantic/tests/main.rs | ||
| input_file: crates/oxc_semantic/tests/fixtures/oxc/ts/export/named/type-and-non-type.ts | ||
| --- | ||
| [ | ||
| { | ||
| "children": [ | ||
| { | ||
| "children": [], | ||
| "flags": "ScopeFlags(StrictMode)", | ||
| "id": 1, | ||
| "node": "TSTypeAliasDeclaration", | ||
| "symbols": [] | ||
| } | ||
| ], | ||
| "flags": "ScopeFlags(StrictMode | Top)", | ||
| "id": 0, | ||
| "node": "Program", | ||
| "symbols": [ | ||
| { | ||
| "flags": "SymbolFlags(BlockScopedVariable | ConstVariable)", | ||
| "id": 0, | ||
| "name": "ToastViewport", | ||
| "node": "VariableDeclarator(ToastViewport)", | ||
| "references": [ | ||
| { | ||
| "flags": "ReferenceFlags(Read)", | ||
| "id": 1, | ||
| "name": "ToastViewport", | ||
| "node_id": 14 | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "flags": "SymbolFlags(TypeAlias)", | ||
| "id": 1, | ||
| "name": "ToastProps", | ||
| "node": "TSTypeAliasDeclaration", | ||
| "references": [ | ||
| { | ||
| "flags": "ReferenceFlags(Type)", | ||
| "id": 0, | ||
| "name": "ToastProps", | ||
| "node_id": 11 | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] |
4 changes: 4 additions & 0 deletions
4
crates/oxc_semantic/tests/fixtures/oxc/ts/export/named/type-and-non-type.ts
This file contains hidden or 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,4 @@ | ||
| const ToastViewport = 1; | ||
| type ToastProps = string; | ||
|
|
||
| export { type ToastProps, ToastViewport }; |
This file contains hidden or 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 hidden or 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
4 changes: 4 additions & 0 deletions
4
.../tests/babel-plugin-transform-typescript/test/fixtures/exports/type-and-non-type/input.ts
This file contains hidden or 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,4 @@ | ||
| const ToastViewport = 1; | ||
| type ToastProps = string; | ||
|
|
||
| export { type ToastProps, ToastViewport }; |
2 changes: 2 additions & 0 deletions
2
...tests/babel-plugin-transform-typescript/test/fixtures/exports/type-and-non-type/output.js
This file contains hidden or 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,2 @@ | ||
| const ToastViewport = 1; | ||
| export { ToastViewport }; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.