{"name":"prettier-plugin-tailwindcss","version":"0.0.0-insiders.10e0c19","license":"MIT","_id":"prettier-plugin-tailwindcss@0.0.0-insiders.10e0c19","maintainers":[{"name":"malfaitrobin","email":"malfait.robin@gmail.com"},{"name":"bradlc","email":"bradlc41@gmail.com"},{"name":"adamwathan","email":"adam@adamwathan.me"},{"name":"reinink","email":"jonathan@reinink.ca"},{"name":"thecrypticace","email":"thecrypticace@gmail.com"}],"homepage":"https://github.com/tailwindlabs/prettier-plugin-tailwindcss#readme","bugs":{"url":"https://github.com/tailwindlabs/prettier-plugin-tailwindcss/issues"},"dist":{"shasum":"0a84aba060cde80b9052ca5729f20be8baac5643","tarball":"http://registry-npm.ywwl.com/prettier-plugin-tailwindcss/download/prettier-plugin-tailwindcss-0.0.0-insiders.10e0c19.tgz","fileCount":32,"integrity":"sha512-ee1EJXimZNpAREYugYSZfYs6Oub8k/48sdI4fnhbwGPI0NVVAjmvr+UoRF8XFto6twilqeoWUIF/y4yIuV+DjQ==","signatures":[{"sig":"MEQCIEhK0thWfCtxQUlZaR9EUzFsSVy7MiOsyj07fbS85tomAiA9bGb+yptBTFOEq3O1hjv0BVC9mald3d+9wW6+0nPybg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2545101,"size":619697,"noattachment":false,"key":"/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.0.0-insiders.10e0c19.tgz"},"jest":{"testTimeout":15000},"main":"dist/index.mjs","types":"dist/index.d.ts","module":"dist/index.mjs","readme":"<img src=\"https://raw.githubusercontent.com/tailwindlabs/prettier-plugin-tailwindcss/main/.github/banner.jpg\" alt=\"prettier-plugin-tailwindcss\" />\n\nA [Prettier v3+](https://prettier.io/) plugin for Tailwind CSS v3.0+ that automatically sorts classes based on [our recommended class order](https://tailwindcss.com/blog/automatic-class-sorting-with-prettier#how-classes-are-sorted).\n\n## Installation\n\nTo get started, install `prettier-plugin-tailwindcss` as a dev-dependency:\n\n```sh\nnpm install -D prettier prettier-plugin-tailwindcss\n```\n\nThen add the plugin to your [Prettier config](https://prettier.io/docs/en/configuration.html):\n\n```js\n// prettier.config.js\nmodule.exports = {\n  plugins: ['prettier-plugin-tailwindcss'],\n}\n```\n\n## Upgrading to v0.5.x\n\nAs of v0.5.x, this plugin now requires Prettier v3 and is ESM-only. This means it cannot be loaded via `require()`. For more information see our [upgrade guide](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/issues/207#issuecomment-1698071122).\n\n## Options\n\n### Customizing your Tailwind config path\n\nTo ensure that the class sorting takes into consideration any of your project's Tailwind customizations, it needs access to your [Tailwind configuration file](https://tailwindcss.com/docs/configuration) (`tailwind.config.js`).\n\nBy default the plugin will look for this file in the same directory as your Prettier configuration file. However, if your Tailwind configuration is somewhere else, you can specify this using the `tailwindConfig` option in your Prettier configuration.\n\nNote that paths are resolved relative to the Prettier configuration file.\n\n```js\n// prettier.config.js\nmodule.exports = {\n  tailwindConfig: './styles/tailwind.config.js',\n}\n```\n\nIf a local configuration file cannot be found the plugin will fallback to the default Tailwind configuration.\n\n## Sorting non-standard attributes\n\nBy default this plugin only sorts classes in the `class` attribute as well as any framework-specific equivalents like `class`, `className`, `:class`, `[ngClass]`, etc.\n\nYou can sort additional attributes using the `tailwindAttributes` option, which takes an array of attribute names:\n\n```js\n// prettier.config.js\nmodule.exports = {\n  tailwindAttributes: ['myClassList'],\n}\n```\n\nWith this configuration, any classes found in the `myClassList` attribute will be sorted:\n\n```jsx\nfunction MyButton({ children }) {\n  return (\n    <button myClassList=\"rounded bg-blue-500 px-4 py-2 text-base text-white\">\n      {children}\n    </button>\n  );\n}\n```\n\n## Sorting classes in function calls\n\nIn addition to sorting classes in attributes, you can also sort classes in strings provided to function calls. This is useful when working with libraries like [clsx](https://github.com/lukeed/clsx) or [cva](https://cva.style/).\n\nYou can sort classes in function calls using the `tailwindFunctions` option, which takes a list of function names:\n\n```js\n// prettier.config.js\nmodule.exports = {\n  tailwindFunctions: ['clsx'],\n}\n```\n\nWith this configuration, any classes in `clsx()` function calls will be sorted:\n\n```jsx\nimport clsx from 'clsx'\n\nfunction MyButton({ isHovering, children }) {\n  let classes = clsx(\n    'rounded bg-blue-500 px-4 py-2 text-base text-white',\n    {\n      'bg-blue-700 text-gray-100': isHovering,\n    },\n  )\n\n  return (\n    <button className={classes}>\n      {children}\n    </button>\n  )\n}\n```\n\n## Sorting classes in template literals\n\nThis plugin also enables sorting of classes in tagged template literals.\n\nYou can sort classes in template literals using the `tailwindFunctions` option, which takes a list of function names:\n\n```js\n// prettier.config.js\nmodule.exports = {\n  tailwindFunctions: ['tw'],\n}\n```\n\nWith this configuration, any classes in template literals tagged with `tw` will automatically be sorted:\n\n```jsx\nimport { View, Text } from 'react-native'\nimport tw from 'twrnc'\n\nfunction MyScreen() {\n  return (\n    <View style={tw`bg-white p-4 dark:bg-black`}>\n      <Text style={tw`text-md text-black dark:text-white`}>Hello World</Text>\n    </View>\n  )\n}\n```\n\nThis feature can be used with third-party libraries like `twrnc` or you can create your own tagged template by defining this \"identity\" function:\n\n```js\nconst tw = (strings, ...values) => String.raw({ raw: strings }, ...values)\n```\n\nOnce added, tag your strings with the function and the plugin will sort them:\n\n```js\nconst mySortedClasses = tw`bg-white p-4 dark:bg-black`\n```\n\n## Compatibility with other Prettier plugins\n\nThis plugin uses Prettier APIs that can only be used by one plugin at a time, making it incompatible with other Prettier plugins implemented the same way. To solve this we've added explicit per-plugin workarounds that enable compatibility with the following Prettier plugins:\n\n- `@ianvs/prettier-plugin-sort-imports`\n- `@prettier/plugin-pug`\n- `@shopify/prettier-plugin-liquid`\n- `@trivago/prettier-plugin-sort-imports`\n- `prettier-plugin-astro`\n- `prettier-plugin-css-order`\n- `prettier-plugin-import-sort`\n- `prettier-plugin-jsdoc`\n- `prettier-plugin-organize-attributes`\n- `prettier-plugin-organize-imports`\n- `prettier-plugin-style-order`\n- `prettier-plugin-svelte`\n- `prettier-plugin-sort-imports`\n\nOne limitation with this approach is that `prettier-plugin-tailwindcss` *must* be loaded last.\n\n```json5\n// .prettierrc\n{\n  // ..\n  \"plugins\": [\n    \"prettier-plugin-svelte\",\n    \"prettier-plugin-organize-imports\",\n    \"prettier-plugin-tailwindcss\" // MUST come last\n  ]\n}\n```\n","engines":{"node":">=14.21.3"},"gitHead":"10e0c193dd93da476fdc6c8561bbfef9beb7e115","scripts":{"dev":"npm run _esbuild -- --watch","_pre":"rimraf dist && cpy 'node_modules/tailwindcss/lib/css/*' dist/css","test":"NODE_OPTIONS=--experimental-vm-modules jest","build":"npm run _esbuild -- --minify","format":"prettier \"src/**/*.js\" \"scripts/**/*.js\" \"tests/test.js\" --write --print-width 100 --single-quote --no-semi --plugin-search-dir ./tests","predev":"npm run _pre","pretest":"node scripts/install-fixture-deps.js","_esbuild":"node build.mjs","prebuild":"npm run _pre","release-notes":"node ./scripts/release-notes.js","prepublishOnly":"npm run build && node scripts/copy-licenses.js","release-channel":"node ./scripts/release-channel.js"},"_npmUser":{"name":"thecrypticace","email":"thecrypticace@gmail.com"},"importSort":{".js, .jsx, .ts, .tsx":{"style":"module"}},"repository":{"url":"git+https://github.com/tailwindlabs/prettier-plugin-tailwindcss.git","type":"git"},"_npmVersion":"8.19.4","description":"A Prettier plugin for sorting Tailwind CSS classes.","directories":{},"_nodeVersion":"16.20.2","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.6.2","jsesc":"^2.5.2","marko":"^5.31.18","recast":"0.20.5","rimraf":"^5.0.5","svelte":"^4.2.8","cpy-cli":"^5.0.0","esbuild":"^0.19.8","postcss":"^8.4.35","escalade":"^3.1.1","prettier":"^3.2","line-column":"^1.0.2","tailwindcss":"^3.4.1","clear-module":"^4.1.2","resolve-from":"^5.0.0","postcss-import":"^16.0.1","license-checker":"^25.0.1","@prettier/plugin-pug":"^3.0","prettier-plugin-astro":"^0.12.2","prettier-plugin-jsdoc":"^1.0.1","prettier-plugin-marko":"^3.1.1","prettier-plugin-svelte":"^3.1.2","import-sort-style-module":"^6.0.0","prettier-plugin-css-order":"^2.0.0","prettier-plugin-import-sort":"^0.0.7","prettier-plugin-style-order":"^0.2.2","prettier-plugin-sort-imports":"^1.8.1","@shopify/prettier-plugin-liquid":"^1.4.0","prettier-plugin-organize-imports":"^3.2.4","@ianvs/prettier-plugin-sort-imports":"^4.1.0","prettier-plugin-organize-attributes":"^1.0.0","@trivago/prettier-plugin-sort-imports":"^4.3.0"},"peerDependencies":{"prettier":"^3.0","@prettier/plugin-pug":"*","prettier-plugin-astro":"*","prettier-plugin-jsdoc":"*","prettier-plugin-marko":"*","prettier-plugin-svelte":"*","prettier-plugin-css-order":"*","prettier-plugin-import-sort":"*","prettier-plugin-style-order":"*","prettier-plugin-sort-imports":"*","@shopify/prettier-plugin-liquid":"*","prettier-plugin-organize-imports":"*","@ianvs/prettier-plugin-sort-imports":"*","prettier-plugin-organize-attributes":"*","@trivago/prettier-plugin-sort-imports":"*"},"peerDependenciesMeta":{"@prettier/plugin-pug":{"optional":true},"prettier-plugin-astro":{"optional":true},"prettier-plugin-jsdoc":{"optional":true},"prettier-plugin-marko":{"optional":true},"prettier-plugin-svelte":{"optional":true},"prettier-plugin-css-order":{"optional":true},"prettier-plugin-import-sort":{"optional":true},"prettier-plugin-style-order":{"optional":true},"prettier-plugin-twig-melody":{"optional":true},"prettier-plugin-sort-imports":{"optional":true},"@shopify/prettier-plugin-liquid":{"optional":true},"prettier-plugin-organize-imports":{"optional":true},"@ianvs/prettier-plugin-sort-imports":{"optional":true},"prettier-plugin-organize-attributes":{"optional":true},"@trivago/prettier-plugin-sort-imports":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/prettier-plugin-tailwindcss_0.0.0-insiders.10e0c19_1711127890904_0.02545991631364597","host":"s3://npm-registry-packages"},"publish_time":1711127891125,"_cnpm_publish_time":1711127891125,"dist-tags":{"beta":"0.2.0-beta.3","insiders":"0.0.0-insiders.5b27f94","latest":"0.8.1"}}