Organize imports should remove blank lines within imports
See original GitHub issueTypeScript Version: 2.9.0-dev.20190327
Search Terms:
- Organize imports
Code
- For the js:
import { x } from 'x';
import { y } from 'y';
console.log(x, y)
- Run organize imports.
Expected behavior: Blank lines within the import are removed
import { x } from 'x';
import { y } from 'y';
console.log(x, y)
Actual behavior: Blanklines preserved but shifted to end of imports:
import { x } from 'x';
import { y } from 'y';
console.log(x, y)
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
source.organizeImports must not remove empty line between ...
Usually imports are organized in groups separated by empty line (e.g. node packages, services, components). I think that organizeImports should respect ...
Read more >How to stop Eclipse from inserting blank line between import ...
Make sure the Remove excess blank lines button right of the Between import groups selector is pressed.
Read more >Imports - checkstyle
imports will be sorted in the groups; groups are separated by single blank line. Notes: "com" package is not mentioned on configuration, because ......
Read more >scalafix-organize-imports - Scaladex
To make it easier to add OrganizeImports into existing Scala projects built using ... A blank line is automatically inserted between adjacent import...
Read more >Eclipse Platform » Supressing blank line between import groups
Look in Windows > Preferences > Java > Code Style > Organize Imports HTH, Vijay Steven Caswell wrote: > I've looked everywhere I...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I agree that the current behavior of moving blank lines to the end of the imports is not helpful. But removing them in general is also not always desired. I like to group my imports using blank lines. For example one block of imports could be related to DB stuff and another one to features from math libraries.
Maybe the removal of blank lines could be optional via a config flag?
+1 to have a flag to allow keeping spaces/groups.