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

useImportType Formatting Exception #1550

Open
1 task done
ayangweb opened this issue Jan 13, 2024 · 5 comments
Open
1 task done

useImportType Formatting Exception #1550

ayangweb opened this issue Jan 13, 2024 · 5 comments
Assignees
Labels
A-Linter Area: linter S-Bug-confirmed Status: report has been confirmed as a valid bug

Comments

@ayangweb
Copy link

Environment information

CLI:
  Version:                      1.5.1
  Color support:                true

Platform:
  CPU Architecture:             aarch64
  OS:                           macos

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v16.14.2"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "npm/8.5.0"

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

Workspace:
  Open Documents:               0

Configuration

{
	"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
	"linter": {
		"enabled": true,
		"rules": {
			"recommended": true,
			"nursery": {
				"useImportType": "error"
			}
		}
	}
}

Playground link

iShot_2024-01-13_17.58.15.mp4

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@ayangweb ayangweb changed the title useImportType Formatting Error useImportType Formatting Exception Jan 13, 2024
@ematipico ematipico added A-Linter Area: linter S-Bug-confirmed Status: report has been confirmed as a valid bug labels Jan 13, 2024
@ayangweb
Copy link
Author

Restarting vscode works, but after a while it still throws an exception!

@unvalley
Copy link
Member

@ayangweb I attempted to reproduce the error using the configuration you attached, but was unable to confirm it. What command are you using to save the file?

@ayangweb
Copy link
Author

@ayangweb I attempted to reproduce the error using the configuration you attached, but was unable to confirm it. What command are you using to save the file?

+ S shortcut to save!

@Conaclos
Copy link
Member

This is certainly related to #1570

@niklas-e
Copy link

Didn't manage to reproduce this exact issue shown in the OP video, but quite often this rule seems to cause similar results while writing code normally and applying fixes via saving.

Basically all of the sudden fix starts adding excessive type keyword(s) and from there successive fixes start to go bonkers and remove code, usually from surrounding import lines (not necessarily whole lines). Only restarting vscode seems to fix the situation... until it happens again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Linter Area: linter S-Bug-confirmed Status: report has been confirmed as a valid bug
Projects
None yet
Development

No branches or pull requests

6 participants