-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Preserve leading trivia when organizing imports #22832
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| // ==ORIGINAL== | ||
|
|
||
| // Header | ||
|
|
||
| import "lib2"; | ||
| import "lib1"; | ||
|
|
||
| // ==ORGANIZED== | ||
|
|
||
| // Header | ||
|
|
||
| import "lib1"; | ||
| import "lib2"; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| // ==ORIGINAL== | ||
|
|
||
| // Header | ||
|
|
||
| import { F1 } from "lib"; | ||
|
|
||
| // ==ORGANIZED== | ||
|
|
||
| // Header | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,3 +4,4 @@ | |
|
|
||
| // ==ORGANIZED== | ||
|
|
||
| /*A*/ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,6 @@ F1(); | |
|
|
||
| // ==ORGANIZED== | ||
|
|
||
| /*A*/ import /*B*/ { /*C*/ F1 /*D*/ } /*G*/ from /*H*/ "lib" /*I*/; /*J*/ //K | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure why we lost the space, but it doesn't seem very problematic since this commenting pattern is very unusual. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like the space wasn't present in the input, so this is a good change. |
||
| /*A*/import /*B*/ { /*C*/ F1 /*D*/ } /*G*/ from /*H*/ "lib" /*I*/; /*J*/ //K | ||
|
|
||
| F1(); | ||
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.
Seems unnecessary as
getOrCreateEmitNodewill crash on undefined input anyway, and as of #22088 the type system should help with this.