Skip to content
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

📝 import sorting is messing up spaces between ts type and non-type imports #1665

Closed
1 task done
valkum opened this issue Jan 25, 2024 · 2 comments · Fixed by #2602
Closed
1 task done

📝 import sorting is messing up spaces between ts type and non-type imports #1665

valkum opened this issue Jan 25, 2024 · 2 comments · Fixed by #2602
Assignees
Labels
A-Analyzer Area: analyzer S-Bug-confirmed Status: report has been confirmed as a valid bug S-Help-wanted Status: you're familiar with the code base and want to help the project

Comments

@valkum
Copy link

valkum commented Jan 25, 2024

Environment information

CLI:
  Version:                      1.5.3
  Color support:                true

Platform:
  CPU Architecture:             aarch64
  OS:                           macos

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v21.6.0"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "yarn/4.0.2"

Biome Configuration:
  Status:                       Loaded successfully
  Formatter disabled:           false
  Linter disabled:              false
  Organize imports disabled:    false
  VCS disabled:                 true

Workspace:
  Open Documents:               0

Configuration

No response

Playground link

https://biomejs.dev/playground/?indentStyle=space&indentWidth=4&code=aQBtAHAAbwByAHQAIAB7AHQAeQBwAGUAIABDAG8AbgB0AGEAYwB0AE8AcAB0AGkAbwBuACwAIABsAG8AYQBkAFMAdAByAGkAcABlACwAIAB0AHkAcABlACAAUwB0AHIAaQBwAGUARQBsAGUAbQBlAG4AdABzAE8AcAB0AGkAbwBuAHMAfQAgAGYAcgBvAG0AIAAnAEAAcwB0AHIAaQBwAGUALwBzAHQAcgBpAHAAZQAtAGoAcwAnADsA

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@ematipico ematipico added S-Help-wanted Status: you're familiar with the code base and want to help the project S-Bug-confirmed Status: report has been confirmed as a valid bug A-Analyzer Area: analyzer labels Jan 25, 2024
@unvalley
Copy link
Member

unvalley commented Feb 6, 2024

I think this is an issue of whitespace handling by sorting, not just with or without type import.

-import {l1, l3,l2} from 'l';
+import {l1, l2,l3} from 'l';
 
-import {type m1, m3, type m2} from 'm';
+import {type m1, type m2,m3 } from 'm';
 
-import { n1, n3, n2} from 'n';
+import { n1, n2,n3 } from 'n';
 
-import {o1, o3, o2} from 'o';
+import {o1, o2,o3 } from 'o';

@colachg
Copy link

colachg commented Mar 19, 2024

Same here, auto add type on saving.
import type React from 'react' --> import type React from 'react'

I just disable the quickfix for .tsx files on my side.

updates:
Even I disabled the linter in biome.jsonc, the biome quickfix on save action still work with the rule useImportType.
I have to make it off explicitly like this:

...
  "linter": {
    "enabled": false,
    "rules": {
      "style": {
        "useImportType": "off". <-----
      }
    }
  },
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Analyzer Area: analyzer S-Bug-confirmed Status: report has been confirmed as a valid bug S-Help-wanted Status: you're familiar with the code base and want to help the project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants