You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+25-12Lines changed: 25 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,8 +10,19 @@ Rules enforcing best practices and consistency using [Tailwind CSS](https://tail
10
10
>
11
11
> 👍 Most of [the new JIT mode features](https://tailwindcss.com/docs/just-in-time-mode#new-features) are also supported.
12
12
13
+
## Supported Rules
14
+
15
+
Learn more about each supported rules by reading their documentation:
16
+
17
+
-[`classnames-order`](docs/rules/classnames-order.md): order classnames by target properties then by variants (`[size:][theme:][state:]`)
18
+
-[`no-custom-classname`](docs/rules/no-custom-classname.md): only allow classnames from Tailwind CSS and the values from the `whitelist` option
19
+
-[`no-contradicting-classname`](docs/rules/no-contradicting-classname.md): e.g. avoid `p-2 p-3`, different Tailwind CSS classnames (`pt-2` & `pt-3`) but targeting the same property several times for the same variant.
20
+
21
+
Using ESLint extension for Visual Studio Code, you will get these messages
[eslint-plugin-tailwindcss on npm](https://www.npmjs.com/package/eslint-plugin-tailwindcss)
30
-
31
-
## Usage
32
-
33
40
Add `tailwindcss` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:
34
41
35
42
```json
@@ -38,8 +45,22 @@ Add `tailwindcss` to the plugins section of your `.eslintrc` configuration file.
38
45
}
39
46
```
40
47
48
+
## Configuration
49
+
50
+
Use our preset to get reasonable defaults:
51
+
52
+
```
53
+
"extends": [
54
+
"plugin:tailwindcss/recommended"
55
+
]
56
+
```
57
+
58
+
If you do not use a preset you will need to specify individual rules and add extra configuration:
59
+
41
60
Configure the rules you want to use under the rules section.
42
61
62
+
> The following lines are matching the configuration saved `recommended` preset...
63
+
43
64
```json
44
65
{
45
66
"rules": {
@@ -83,14 +104,6 @@ The plugin will look for each setting value in this order and stop looking as so
83
104
2. In the shared settings (plugin level)
84
105
3. Default value of the requested setting (plugin level)...
85
106
86
-
## Supported Rules
87
-
88
-
Learn more about each supported rules by reading their documentation:
89
-
90
-
-[`classnames-order`](docs/rules/classnames-order.md): order classnames by target properties then by variants (`[size:][theme:][state:]`)
91
-
-[`no-custom-classname`](docs/rules/no-custom-classname.md): only allow classnames from Tailwind CSS and the values from the `whitelist` option
92
-
-[`no-contradicting-classname`](docs/rules/no-contradicting-classname.md): e.g. avoid `p-2 p-3`, different Tailwind CSS classnames (`pt-2` & `pt-3`) but targeting the same property several times for the same variant.
93
-
94
107
## Upcoming Rules
95
108
96
109
-`no-redundant-variant`: e.g. avoid `mx-5 sm:mx-5`, no need to redefine `mx` in `sm:` variant as it uses the same value (`5`)
0 commit comments