Skip to content

Commit 692ac75

Browse files
authored
Document how to load the Prettier plugin (#1718)
1 parent 1d4a750 commit 692ac75

File tree

1 file changed

+10
-2
lines changed
  • src/pages/blog/automatic-class-sorting-with-prettier

1 file changed

+10
-2
lines changed

src/pages/blog/automatic-class-sorting-with-prettier/index.mdx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,21 @@ This plugin scans your templates for class attributes containing Tailwind CSS cl
2525

2626
It works seamlessly with custom Tailwind configurations, and because it's just a [Prettier](https://prettier.io/) plugin, it works anywhere Prettier works — including every popular editor and IDE, and of course on the command line.
2727

28-
To get started, just install `prettier-plugin-tailwindcss` as a dev-dependency:
28+
To get started, install `prettier-plugin-tailwindcss` as a dev-dependency:
2929

3030
```sh {{ filename: 'Terminal' }}
3131
npm install -D prettier prettier-plugin-tailwindcss
3232
```
3333

34-
This plugin follows Prettier's [autoloading convention](https://prettier.io/docs/en/plugins.html), so as long as you've got Prettier set up in your project, it'll start working automatically as soon as it's installed.
34+
Then add the plugin to your [Prettier configuration file](https://prettier.io/docs/en/configuration):
35+
36+
```json {{ filename: '.prettierrc' }}
37+
{
38+
"plugins": ["prettier-plugin-tailwindcss"]
39+
}
40+
```
41+
42+
You can also [load the plugin by using the `--plugin` flag with the Prettier CLI, or by using the `plugins` option with the Prettier API](https://prettier.io/docs/en/plugins.html#using-plugins).
3543

3644
---
3745

0 commit comments

Comments
 (0)