Skip to content

Commit 08ad2f6

Browse files
committed
feat(tailwindcss): eslint-plugin-tailwindcss adjusted to peerDependencies
1 parent 72c4b85 commit 08ad2f6

File tree

4 files changed

+17
-11
lines changed

4 files changed

+17
-11
lines changed

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"eslint-plugin-react-hooks": "^4.6.0",
5555
"eslint-plugin-react-refresh": "^0.4.4",
5656
"eslint-plugin-svelte": "^2.34.1",
57+
"eslint-plugin-tailwindcss": "^3.16.0",
5758
"svelte-eslint-parser": "^0.33.1"
5859
},
5960
"peerDependenciesMeta": {
@@ -72,6 +73,9 @@
7273
"eslint-plugin-svelte": {
7374
"optional": true
7475
},
76+
"eslint-plugin-tailwindcss": {
77+
"optional": true
78+
},
7579
"svelte-eslint-parser": {
7680
"optional": true
7781
}
@@ -95,7 +99,6 @@
9599
"eslint-plugin-no-only-tests": "^3.1.0",
96100
"eslint-plugin-perfectionist": "^2.10.0",
97101
"eslint-plugin-regexp": "^2.6.0",
98-
"eslint-plugin-tailwindcss": "^3.15.2",
99102
"eslint-plugin-unicorn": "^53.0.0",
100103
"eslint-plugin-unused-imports": "^3.2.0",
101104
"eslint-plugin-vitest": "^0.5.4",
@@ -129,6 +132,7 @@
129132
"eslint-plugin-react-hooks": "^4.6.2",
130133
"eslint-plugin-react-refresh": "^0.4.7",
131134
"eslint-plugin-svelte": "2.39.0",
135+
"eslint-plugin-tailwindcss": "^3.16.0",
132136
"execa": "^9.1.0",
133137
"fast-glob": "^3.3.2",
134138
"fs-extra": "^11.2.0",

pnpm-lock.yaml

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/configs/tailwindcss.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
import { interopDefault } from '../shared'
1+
import { ensurePackages, interopDefault } from '../shared'
22
import type { OptionsOverrides, TypedFlatConfigItem } from '../types'
33

44
export async function tailwindcss(
55
options: OptionsOverrides = {},
66
): Promise<TypedFlatConfigItem[]> {
77
const { overrides } = options
8+
9+
await ensurePackages(['eslint-plugin-tailwindcss'])
10+
811
const pluginTailwindcss = await interopDefault(
912
import('eslint-plugin-tailwindcss'),
1013
)
@@ -21,7 +24,7 @@ export async function tailwindcss(
2124
'tailwindcss/enforces-shorthand': 'warn',
2225
'tailwindcss/migration-from-tailwind-2': 'warn',
2326
'tailwindcss/no-arbitrary-value': 'off',
24-
'tailwindcss/no-contradicting-classname': 'error',
27+
'tailwindcss/no-contradicting-classname': 'warn',
2528
'tailwindcss/no-custom-classname': 'off',
2629
'tailwindcss/no-unnecessary-arbitrary-value': 'warn',
2730

src/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import {
3232
} from './shared'
3333
import {
3434
isInEditor as defaultIsInEditor,
35-
hasTailwindCSS,
3635
hasTypeScript,
3736
hasVue,
3837
} from './env'
@@ -93,7 +92,7 @@ export async function defineConfig(
9392
react: enableReact = false,
9493
regexp: enableRegexp = true,
9594
svelte: enableSvelte = false,
96-
tailwindcss: enableTailwindCSS = hasTailwindCSS,
95+
tailwindcss: enableTailwindCSS = false,
9796
typescript: enableTypeScript = hasTypeScript,
9897
unocss: enableUnoCSS = false,
9998
vue: enableVue = hasVue,

0 commit comments

Comments
 (0)