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

lint/useImportType and lint/useExportType code fixes wrongly handle multiline statements #2041

Closed
1 task done
revosw opened this issue Mar 11, 2024 · 0 comments · Fixed by #2045
Closed
1 task done
Assignees
Labels
A-Linter Area: linter L-JavaScript Language: JavaScript and super languages S-Enhancement Status: Improve an existing feature

Comments

@revosw
Copy link

revosw commented Mar 11, 2024

Environment information

CLI:
  Version:                      1.6.0
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           windows

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         unset
  JS_RUNTIME_VERSION:           "v21.6.1"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "pnpm/8.1.1"

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

Linter:
  Recommended:                  true
  All:                          false
  Rules:
Workspace:
  Open Documents:               0

Rule name

useImportType

Playground link

https://github.com/revosw/biome-useImportType-repro

Expected result

Expected export:

export {
	a,
	type AAAAAAAAAAAAAA,
	type BBBBBBBBBBBBBB,
	type CCCCCCCCCCCCCC,
	type DDDDDDDDDDDDDD,
	type EEEEEEEEEEEEEE,
};

Actual export:

export {
	a,
	type
	AAAAAAAAAAAAAA,
	type
	BBBBBBBBBBBBBB,
	type
	CCCCCCCCCCCCCC,
	type
	DDDDDDDDDDDDDD,
	type
	EEEEEEEEEEEEEE,
};

Expected import:

import {
	a,
	type AAAAAAAAAAAAAA,
	type BBBBBBBBBBBBBB,
	type CCCCCCCCCCCCCC,
	type DDDDDDDDDDDDDD,
	type EEEEEEEEEEEEEE,
} from "./exportedstuff.ts";

Actual import:

import {
	a,
	type
	AAAAAAAAAAAAAA,
	type
	BBBBBBBBBBBBBB,
	type
	CCCCCCCCCCCCCC,
	type
	DDDDDDDDDDDDDD,
	type
	EEEEEEEEEEEEEE,
} from "./exportedstuff.ts";

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@Conaclos Conaclos changed the title type SomeType broken into two separate lines in multiline import/export statements lint/useImportType and lint/useExportType code fixes wrongly handle multiline statements Mar 11, 2024
@Conaclos Conaclos added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages S-Enhancement Status: Improve an existing feature labels Mar 11, 2024
@Conaclos Conaclos self-assigned this Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Linter Area: linter L-JavaScript Language: JavaScript and super languages S-Enhancement Status: Improve an existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants