DEPRECATED: use https://github.com/PutziSan/prettier-plugin-sort-class-names instead
yarn add tailwind-sort-class-names
yarn run tw-scn your-file.tsx [... other files seperated by empty space]
Neues external tool erstellen via Settings > Tools > External Tools > +
Program:
=> path to yarn-binary (e.g.C:\Program Files (x86)\Yarn\bin\yarn
)Arguments
:node sort-class-names.js $FilePath$
tw-scn
(script from this repo - you need to copy it into your workspace)- (empty space to seperate the script from its argument)
$FilePath$
which is the currently edited file
Working Directory:
=>$ProjectFileDir$
(so that the node-script can use the node_modules folder correctly with the correct wrking dir)- uncheck
open console for tool output
- check
Synchronize Files after execution
Neuen custom File Watcher
erstellen via Settings > Tools > File Watchers > +
> custom und wie folgt einrichten:
Program:
=> path to yarn-binary (e.g.C:\Program Files (x86)\Yarn\bin\yarn
)Arguments
:node sort-class-names.js $FilePath$
node sort-class-names.js
(script from this repo - you need to copy it into your workspace)- (empty space to seperate the script from its argument)
$FilePath$
which is the currently edited file
Output paths to refres:
=>$FilePath$
Working Directory:
=>$ProjectFileDir$
(so that the node-script can use the node_modules folder correctly with the correct wrking dir)- (ausklappen von "Working directory and Environment Variables")
- disable
Auto-save edited files to trigger the watcher
- (make sure to not use prettier on save on this files)