{"name":"prettier-plugin-tailwindcss","version":"0.0.0-insiders.36f92f3","license":"MIT","_id":"prettier-plugin-tailwindcss@0.0.0-insiders.36f92f3","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":"05ae24f48ad6bc4ae3966abf9869b150fd9430f6","tarball":"http://registry-npm.ywwl.com/prettier-plugin-tailwindcss/download/prettier-plugin-tailwindcss-0.0.0-insiders.36f92f3.tgz","fileCount":31,"integrity":"sha512-0mCyfKFC9NOutR2IXJLnWZohi7T9HiQrczFFTJHNPQifnBrMw8sAaQKQO33PYZpBUh3i6l+JreIQ3TVZw7YmIg==","signatures":[{"sig":"MEQCIH0lQkAKTSqwISP7s61fXApPes0P8yzItF48W956vpExAiAK4SdlfGWxXc66NNBXEKoSWfyldV5FAbrr4kkfDb9sMA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2516718,"size":607544,"noattachment":false,"key":"/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.0.0-insiders.36f92f3.tgz"},"jest":{"testTimeout":15000},"main":"dist/index.js","types":"./dist/index.d.ts","readme":"<img src=\"https://raw.githubusercontent.com/tailwindlabs/prettier-plugin-tailwindcss/main/.github/banner.jpg\" alt=\"prettier-plugin-tailwindcss\" />\n\nA [Prettier](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:\n\n```js\n// prettier.config.js\nmodule.exports = {\n  plugins: ['prettier-plugin-tailwindcss'],\n}\n```\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\n## Compatibility with other Prettier plugins\n\n**Note: when using Prettier v3.0 compatability with external plugins does not currently work. We're actively working to rectify this situation.**\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- `@prettier/plugin-pug`\n- `@shopify/prettier-plugin-liquid`\n- `@ianvs/prettier-plugin-sort-imports`\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-twig-melody`\n\nOne limitation with this approach is that `prettier-plugin-tailwindcss` *must* be loaded last.\n\nAdditionally, if you're using Prettier v2 (but not v3), auto-loading must be disabled by setting the `pluginSearchDirs` option to `false`. This is because auto-loading can result in plugins being loaded after `prettier-plugin-tailwindcss` which breaks our compatability. When using Prettier v3 this is not necessary as it no longer supports autoloading.\n\nFor Prettier v2, list each of your Prettier plugins in the `plugins` array and set `pluginSearchDirs` to `false`:\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  \"pluginSearchDirs\": false // Prettier v2.x only\n}\n```\n\nFor Prettier v3+, list each of your Prettier plugins in the `plugins` array:\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":">=12.17.0"},"gitHead":"36f92f3b9f90a0f436620dc9d5b300be9e70ed59","scripts":{"dev":"npm run _esbuild -- --watch","_pre":"rimraf dist && cpy node_modules/tailwindcss/lib/css dist/css","test":"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 && npm test && 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.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.4.7","jsesc":"^2.5.2","recast":"^0.20.5","rimraf":"^3.0.2","svelte":"^3.55.0","cpy-cli":"^3.1.1","esbuild":"^0.18.0","escalade":"^3.1.1","prettier":"^2.8.8","line-column":"^1.0.2","object-hash":"^2.2.0","tailwindcss":"^3.3.0","clear-module":"^4.1.2","resolve-from":"^5.0.0","license-checker":"^25.0.1","@prettier/plugin-pug":"^2.3.0","prettier-plugin-astro":"^0.7.2","prettier-plugin-jsdoc":"^0.4.2","prettier-plugin-marko":"^1.4.3","prettier-plugin-svelte":"^2.9.0","import-sort-style-module":"^6.0.0","@marko/translator-default":"^5.25.7","prettier-plugin-css-order":"^1.3.0","prettier-plugin-import-sort":"^0.0.7","prettier-plugin-style-order":"^0.2.2","prettier-plugin-twig-melody":"^0.4.6","@shufo/prettier-plugin-blade":"^1.8.4","@shopify/prettier-plugin-liquid":"^1.0.3","prettier-plugin-organize-imports":"^3.2.1","@ianvs/prettier-plugin-sort-imports":"^3.7.0","prettier-plugin-organize-attributes":"^0.0.5","@trivago/prettier-plugin-sort-imports":"^3.4.0"},"peerDependencies":{"prettier":"^2.2 || ^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-twig-melody":"*","@shufo/prettier-plugin-blade":"*","@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},"@shufo/prettier-plugin-blade":{"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.36f92f3_1690565059646_0.9756656931000909","host":"s3://npm-registry-packages"},"publish_time":1690565059876,"_cnpm_publish_time":1690565059876,"dist-tags":{"beta":"0.2.0-beta.3","insiders":"0.0.0-insiders.5b27f94","latest":"0.8.1"}}