diff --git a/fixtures/tailwind.tsx b/fixtures/tailwind.tsx new file mode 100644 index 0000000..79a0fb7 --- /dev/null +++ b/fixtures/tailwind.tsx @@ -0,0 +1,3 @@ +export function Counter(): JSX.Element { + return
foo
+} diff --git a/index.js b/index.js index 56b39f3..f481106 100644 --- a/index.js +++ b/index.js @@ -3,4 +3,6 @@ module.exports = { printWidth: 100, semi: false, singleQuote: true, + plugins: ['prettier-plugin-tailwindcss'], + tailwindFunctions: ['clsx'], } diff --git a/package-lock.json b/package-lock.json index b96e61f..b3120ab 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,7 +22,8 @@ "node": ">=18.12.0" }, "peerDependencies": { - "prettier": "^3.0.0" + "prettier": "^3.0.0", + "prettier-plugin-tailwindcss": "^0.6.0" } }, "node_modules/@ampproject/remapping": { @@ -5533,6 +5534,80 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, + "node_modules/prettier-plugin-tailwindcss": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.6.1.tgz", + "integrity": "sha512-AnbeYZu0WGj+QgKciUgdMnRxrqcxltleZPgdwfA5104BHM3siBLONN/HLW1yS2HvzSNkzpQ/JAj+LN0jcJO+0w==", + "peer": true, + "engines": { + "node": ">=14.21.3" + }, + "peerDependencies": { + "@ianvs/prettier-plugin-sort-imports": "*", + "@prettier/plugin-pug": "*", + "@shopify/prettier-plugin-liquid": "*", + "@trivago/prettier-plugin-sort-imports": "*", + "@zackad/prettier-plugin-twig-melody": "*", + "prettier": "^3.0", + "prettier-plugin-astro": "*", + "prettier-plugin-css-order": "*", + "prettier-plugin-import-sort": "*", + "prettier-plugin-jsdoc": "*", + "prettier-plugin-marko": "*", + "prettier-plugin-organize-attributes": "*", + "prettier-plugin-organize-imports": "*", + "prettier-plugin-sort-imports": "*", + "prettier-plugin-style-order": "*", + "prettier-plugin-svelte": "*" + }, + "peerDependenciesMeta": { + "@ianvs/prettier-plugin-sort-imports": { + "optional": true + }, + "@prettier/plugin-pug": { + "optional": true + }, + "@shopify/prettier-plugin-liquid": { + "optional": true + }, + "@trivago/prettier-plugin-sort-imports": { + "optional": true + }, + "@zackad/prettier-plugin-twig-melody": { + "optional": true + }, + "prettier-plugin-astro": { + "optional": true + }, + "prettier-plugin-css-order": { + "optional": true + }, + "prettier-plugin-import-sort": { + "optional": true + }, + "prettier-plugin-jsdoc": { + "optional": true + }, + "prettier-plugin-marko": { + "optional": true + }, + "prettier-plugin-organize-attributes": { + "optional": true + }, + "prettier-plugin-organize-imports": { + "optional": true + }, + "prettier-plugin-sort-imports": { + "optional": true + }, + "prettier-plugin-style-order": { + "optional": true + }, + "prettier-plugin-svelte": { + "optional": true + } + } + }, "node_modules/prop-types": { "version": "15.8.1", "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", diff --git a/package.json b/package.json index dcdb782..32878a9 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,8 @@ "author": "Kensho Technologies, LLC.", "license": "Apache-2.0", "peerDependencies": { - "prettier": "^3.0.0" + "prettier": "^3.0.0", + "prettier-plugin-tailwindcss": "^0.6.0" }, "devDependencies": { "@babel/core": "^7.24.6",