prettier-plugin-tailwind icon indicating copy to clipboard operation
prettier-plugin-tailwind copied to clipboard

Apply tailwind sort order on variable strings

Open leroynas opened this issue 3 years ago • 0 comments

I would like to be able to sort all the classes that are defined in a variable, this already works with autosuggest in the Visual Studio Code tailwind plugin. I think it would be very smart to use the exact same options for this as are available in the Visual Studio Code extension.

Example:

import React from 'react';

const className = {
  root: `last:border-0 border-l border-gray-200`,
};

const Component = ({ children }) => {
  return <div className={className.root}>{children}</div>;
};

export default Component;

As already stated above, for the Visual Studio Code tailwind extension, the autocomplete and autosuggestions work. So there is a decent way to figure out this pattern. I would recommend checking how it works in that plugin and copy it to this plugin.

leroynas avatar Feb 22 '22 13:02 leroynas