mirror of
https://github.com/coder/coder.git
synced 2026-10-31 11:02:50 +08:00
Finds all class combinations like `w-N h-N` and replaces them with `size-N`. - find: `/w-(\d+) h-\1(?=\s|")/g`, or `/h-(\d+) w-\1(?=\s|")/g` - replace with: `size-$1` The positive lookahead `/(?=\s|")/` matches whitespace or a double quote character after the number, to prevent false matches where the numbers aren't the same but share the same left digits: https://github.com/coder/coder/blob/b3766d62be9487732c7e657cf737e739cc5413da/site/src/pages/WorkspacesPage/WorkspacesTable.tsx#L124 Unfortunately we don't have a way to automatically enforce this, since there's no Biome equivalent for `eslint-plugin-tailwindcss`'s [`enforces-shorthand` rule](https://github.com/francoismassart/eslint-plugin-tailwindcss/blob/HEAD/docs/rules/enforces-shorthand.md)