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

🐛 There is a bug in the useSortedClasses formatting. #3056

Closed
1 task done
ayangweb opened this issue Jun 4, 2024 · 4 comments
Closed
1 task done

🐛 There is a bug in the useSortedClasses formatting. #3056

ayangweb opened this issue Jun 4, 2024 · 4 comments
Labels
A-Linter Area: linter L-JavaScript Language: JavaScript and super languages 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

@ayangweb
Copy link

ayangweb commented Jun 4, 2024

Environment information

CLI:
  Version:                      1.8.0
  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

What happened?

biome.json

{
	"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
	"organizeImports": {
		"enabled": true
	},
	"linter": {
		"enabled": true,
		"rules": {
			"recommended": true,
			"nursery": {
				"useSortedClasses": {
					"level": "error",
					"fix": "safe",
					"options": {}
				}
			}
		}
	}
}

There's a problem with the className formatting, putting h-32 into foucs as well, which is not what I want!

// Before sorting
<input className="h-32 focus:(outline-none border-primary)" />
// After sorting
<input className="focus:(outline-none h-32 border-primary)" />

Expected result

The class name h-32 should not be placed inside foucs:().

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@ayangweb ayangweb changed the title 🐛 <TITLE> 🐛 There is a bug in the useSortedClasses formatting. Jun 4, 2024
@ah-yu ah-yu added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages S-Bug-confirmed Status: report has been confirmed as a valid bug labels Jun 5, 2024
@ematipico ematipico added the S-Help-wanted Status: you're familiar with the code base and want to help the project label Jun 5, 2024
@lutaok
Copy link
Contributor

lutaok commented Jun 15, 2024

There's a problem with the className formatting, putting h-32 into foucs as well, which is not what I want!

// Before sorting
<input className="h-32 focus:(outline-none border-primary)" />
// After sorting
<input className="focus:(outline-none h-32 border-primary)" />

Expected result

The class name h-32 should not be placed inside foucs:().

Hello @ayangweb ,
I don't recognize this as a Tailwind specific syntax, we're still working on useSortedClass and we currently can sort utilities reliably and there's a draft PR #3208 to support variant sorting.
Are you using https://github.com/ben-rogerson/twin.macro by chance?

@ayangweb
Copy link
Author

格式有问题classNameh-32焦点也有问题,这不是我想要的!

// Before sorting
<input className="h-32 focus:(outline-none border-primary)" />
// After sorting
<input className="focus:(outline-none h-32 border-primary)" />

预期结果

类名h-32不应该放在里面foucs:()

你好@ayangweb, 我不认为这是 Tailwind 特有的语法,我们仍在努力useSortedClass,目前我们可以可靠地对实用程序进行排序,并且有一个草案 PR #3208来支持变体排序。 您是否恰好使用了https://github.com/ben-rogerson/twin.macro ?

Hey 👋, I'm using the UnoCSS syntax, but that's okay, until that's supported, it can be written without (),which can be split up!

<input className="h-32 focus:outline-none focus:border-primary" />

@DaniGuardiola
Copy link
Contributor

Hi @ayangweb, thanks for the report. This syntax (unocss variant grouping) is not supported, and there are no plans to support it at this moment. We want to nail the basics first, which are already a lot of work. We could consider it in the future, but we can't promise anything. Thank you!

@ayangweb
Copy link
Author

Hi @ayangweb, thanks for the report. This syntax (unocss variant grouping) is not supported, and there are no plans to support it at this moment. We want to nail the basics first, which are already a lot of work. We could consider it in the future, but we can't promise anything. Thank you!

Ok, I don't think this is a huge issue, it doesn't matter if it's not supported, it's already working very well as far as the current sorting rules are concerned anyway, thanks for providing such a great plugin!😁

@DaniGuardiola DaniGuardiola closed this as not planned Won't fix, can't repro, duplicate, stale Jun 19, 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-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

No branches or pull requests

5 participants