Skip to content

Commit 7d8205f

Browse files
committed
fix(eslint-config): enhance CSS and Tailwind CSS support in ESLint config
- Updated the ESLint configuration to conditionally enable CSS and Tailwind CSS support based on the presence of relevant dependencies in package.json. - This change improves the flexibility of the ESLint setup by allowing automatic detection of required plugins.
1 parent 3b00e49 commit 7d8205f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/eslint-config/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ export const createConfig = async (
161161
const {
162162
astro: enableAstro = hasPackageJsonAnyDependency(packageJson, ["astro"]),
163163
componentExts: componentExtensions = [],
164-
css: enableCss = false,
164+
css: enableCss = hasPackageJsonAnyDependency(packageJson, ["postcss", "cssnano"]),
165165
gitignore: enableGitignore = true,
166166
html: enableHtml = false,
167167
jsx: enableJsx = hasPackageJsonAnyDependency(packageJson, ["eslint-plugin-jsx-a11y", "eslint-plugin-validate-jsx-nesting"]) || hasReact,
@@ -484,7 +484,7 @@ export const createConfig = async (
484484
regexp: enableRegexp = true,
485485
silent = false,
486486
storybook: enableStorybook = hasPackageJsonAnyDependency(packageJson, ["storybook", "eslint-plugin-storybook"]),
487-
tailwindcss: enableTailwindCss = false,
487+
tailwindcss: enableTailwindCss = hasPackageJsonAnyDependency(packageJson, ["tailwindcss", "@tailwindcss/forms", "@tailwindcss/typography", "@tailwindcss/postcss", "eslint-plugin-tailwindcss"]),
488488
tanstackQuery: enableTanstackQuery = hasPackageJsonAnyDependency(packageJson, ["@tanstack/react-query"]),
489489
tanstackRouter: enableTanstackRouter = hasPackageJsonAnyDependency(packageJson, ["@tanstack/react-router"]),
490490
testingLibrary: enableTestingLibrary = hasPackageJsonAnyDependency(packageJson, ["@testing-library/dom", "@testing-library/react"]),

0 commit comments

Comments
 (0)