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

Sorting strings that should not be sorted #108

Open
jradam opened this issue Sep 10, 2024 · 1 comment
Open

Sorting strings that should not be sorted #108

jradam opened this issue Sep 10, 2024 · 1 comment

Comments

@jradam
Copy link
Contributor

jradam commented Sep 10, 2024

Thanks for the great plugin @laytan!

I think I have found a small issue - :TailwindSort seems to sort some strings that should not be sorted.

In the examples below:

  • in a Tailwind string, "hidden test" should become "test hidden" (test counts as a custom user class, so it gets sorted before hidden which is a Tailwind class).
  • in a regular string, "hidden test" is just words and should not be sorted.

Only the .ts example below works correctly for me - each other file type incorrectly sorts the regular string to "test hidden".

Could someone check this by running :TailwindSort on this markdown file in their environment: test.md?

.ts

// This works correctly

const testOne = 'hidden test' // Should not sort
document.createElement('div').outerHTML = `<div class='hidden test'></div>` // Should sort

.tsx

// Issue: both of these sort

const testOne = 'hidden test' // Should not sort
const testTwo = <div className="hidden test"></div> // Should sort

.js

// Issue: both of these sort

const testOne = 'hidden test' // Should not sort
document.createElement('div').outerHTML = `<div class='hidden test'></div>` // Should sort

.jsx

// Issue: both of these sort

const testOne = 'hidden test' // Should not sort
const testTwo = <div className="hidden test"></div> // Should sort
@jradam
Copy link
Contributor Author

jradam commented Sep 10, 2024

Here's the issue in action:

issue.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant