-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Organize imports should remove blank lines within imports #22914
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
Comments
Just to makes dure, I'm New gere, it's approved for community to help on this onde? Evento without the label 😕 |
Sorry, my auto complete feature fault, I'm new here, and we can help on this one? Even without the label? |
Out of interest: How should this behave if there's something else between the import { assert, expect, should } from "chai";
// ... more framework-related imports
// enable the should interface with sinon
should();
// ^^^ --- I want the space here --- vvv
import * as nodeUrl from "url";
// ... more component-related imports |
@AlCalzone I do this too, and in my regular files too, I think it's cool to stay 👍 |
I agree that the current behavior of moving blank lines to the end of the imports is not helpful. Maybe the removal of blank lines could be optional via a config flag? |
I also group my imports with space between them. (libraries/frameworks vs my own code) If preserveSpace is false, then it behaves like it does now, but removing empty lines rather than collecting them at the bottom. |
+1 to have a flag to allow keeping spaces/groups. |
In my experience manually organizing imports by grouping is a maintenance burden that has little value and creates another thing to disagree about. It's a bit easier if the tooling supports it but especially cumbersome when there is also sorting based on some arbitrary hierarchy of importance to the team or individual that birthed it. |
TypeScript Version: 2.9.0-dev.20190327
Search Terms:
Code
Expected behavior:
Blank lines within the import are removed
Actual behavior:
Blanklines preserved but shifted to end of imports:
The text was updated successfully, but these errors were encountered: