Skip to content

Sorting strings that should not be sorted #108

@jradam

Description

@jradam

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions