Skip to content

fix(eslint-config): disable css/no-invalid-at-rules for Tailwind CSS …#1000

Merged
prisis merged 12 commits intomainfrom
fix/css-no-invalid-at-rules-tailwind-crash
Feb 28, 2026
Merged

fix(eslint-config): disable css/no-invalid-at-rules for Tailwind CSS …#1000
prisis merged 12 commits intomainfrom
fix/css-no-invalid-at-rules-tailwind-crash

Conversation

@prisis
Copy link
Member

@prisis prisis commented Feb 27, 2026

…files

Tailwind v4 custom at-rules (@custom-variant, @source, @theme, @Utility) cause @eslint/css-tree to crash with "Bad syntax reference: " when the css/no-invalid-at-rules rule attempts to validate their preludes. Disable the rule when the tailwind option is enabled to prevent the crash.

Summary by CodeRabbit

  • Chores
    • Conditional CSS linting to better accommodate Tailwind v4 at-rules.
    • Reorganized workspace into a granular catalogs block with explicit package globs and focused build-time dependency constraints.
    • Normalized quoting in Nx scripts and adjusted CI Node matrix.
    • Replaced several devDependency pins with catalog placeholders and added sideEffects: false to one package.
    • Expanded textlint packem config to ignore runtime rules and added new ambient type declarations.
    • Conditional Vitest rule toggles when no tsconfigPath is provided.

…files

Tailwind v4 custom at-rules (@custom-variant, @source, @theme, @Utility)
cause @eslint/css-tree to crash with "Bad syntax reference: <parentheses-block>"
when the css/no-invalid-at-rules rule attempts to validate their preludes.
Disable the rule when the tailwind option is enabled to prevent the crash.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Contributor

github-actions bot commented Feb 27, 2026

Thank you for following the naming conventions! 🙏

@coderabbitai
Copy link

coderabbitai bot commented Feb 27, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dee7729 and 2ec33c3.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (23)
  • packages/commitlint-config/package.json
  • packages/eslint-config/package.json
  • packages/eslint-config/src/config/plugins/formatters.ts
  • packages/eslint-config/src/config/plugins/html.ts
  • packages/eslint-config/src/config/plugins/promise.ts
  • packages/eslint-config/src/config/plugins/react.ts
  • packages/eslint-config/src/config/plugins/sonarjs.ts
  • packages/eslint-config/src/config/plugins/storybook.ts
  • packages/eslint-config/src/config/plugins/stylistic.ts
  • packages/eslint-config/src/config/plugins/tailwindcss.ts
  • packages/eslint-config/src/config/plugins/toml.ts
  • packages/eslint-config/src/config/plugins/unicorn.ts
  • packages/eslint-config/src/config/plugins/yml.ts
  • packages/eslint-config/src/config/plugins/you-dont-need-lodash-underscore.ts
  • packages/eslint-config/src/index.ts
  • packages/eslint-config/src/stub.d.ts
  • packages/eslint-config/src/utils/combine.ts
  • packages/eslint-config/src/utils/interop-default.ts
  • packages/eslint-config/src/vender/prettier-types.ts
  • packages/lint-staged-config/package.json
  • packages/stylelint-config/package.json
  • packages/textlint-config/package.json
  • pnpm-workspace.yaml

📝 Walkthrough

Walkthrough

Conditionally disables CSS at-rule validation for Tailwind, adds conditional Vitest rule toggles, tightens TypeScript typings and type assertions across many ESLint plugin configs, restructures pnpm workspace into granular catalogs with package globs and onlyBuiltDependencies, replaces several devDependency pins with catalog: placeholders, updates Nx exclude quoting and CI Node matrix, and adds unused-deps exclusions plus package.json sideEffects flags.

Changes

Cohort / File(s) Summary
ESLint: css plugin
packages/eslint-config/src/config/plugins/css.ts
Change css/no-invalid-at-rules from fixed "error" to tailwind ? "off" : "error" with comment about Tailwind v4 custom at-rules.
ESLint: various plugin typings & guards
packages/eslint-config/src/config/plugins/...
plugins/{formatters,html,promise,react,sonarjs,storybook,stylistic,tailwindcss,toml,unicorn,yml,you-dont-need-lodash-underscore}.ts
Add explicit type assertions/casts, optional chaining guards, generic typing for merge function, consolidated sonarjs rules extraction, and safer access patterns across many plugin configs; some return/value casts changed to TypedFlatConfigItem or Rules.
ESLint: core utilities & types
packages/eslint-config/src/index.ts, .../src/utils/combine.ts, .../src/utils/interop-default.ts, .../src/stub.d.ts, .../vender/prettier-types.ts
Narrowed runtime typings, normalize Promise.resolve for combine inputs, safer default lookup via Record index, add ambient module declarations, and minor lint comment placement.
Vitest rules conditional
packages/eslint-config/src/config/plugins/vitest.ts
Disable vitest/prefer-describe-function-title and vitest/prefer-vi-mocked when tsconfigPath is falsy.
pnpm workspace & catalogs
pnpm-workspace.yaml
Replace flat keys with a hierarchical catalogs block, add packages include/exclude globs, introduce onlyBuiltDependencies, move/reshape overrides and policy keys (shellEmulator/trustPolicy).
Package manifests: devDependency -> catalog placeholders
packages/commitlint-config/package.json, packages/eslint-config/package.json, packages/lint-staged-config/package.json, packages/stylelint-config/package.json, packages/textlint-config/package.json
Swap several devDependency pins (e.g., @anolilab/eslint-config, @anolilab/prettier-config, browserslist-config-anolilab) to catalog: placeholders; reorder files arrays; add sideEffects: false to textlint-config.
textlint packem config
packages/textlint-config/packem.config.ts
Add validation.dependencies.unused.exclude list to ignore runtime-loaded textlint rules from unused-dependency checks.
Nx script formatting
package.json
Wrap exclude patterns in affected Nx scripts with single quotes (formatting only).
CI workflow
.github/workflows/test.yml
Update Node version matrix from ["20","21","22","23","24"] to ["20","22","24","25"]; minor YAML indentation adjustments.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐇 I hopped through configs under moonlight's beam,
Tailwind hushes rules that once would scream,
Catalog carrots stacked in tidy rows,
Types tightened snug where the soft wind blows,
A thump, a stamp—my little repo dream! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly and specifically summarizes the main change: disabling the css/no-invalid-at-rules rule for Tailwind CSS to prevent crashes caused by Tailwind v4 custom at-rules.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/css-no-invalid-at-rules-tailwind-crash

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

prisis and others added 7 commits February 28, 2026 00:23
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The pnpm shell emulator expands unquoted globs and throws "No matches
found" when *-bench doesn't match any files. Single-quoting the value
prevents expansion in both the pnpm shell emulator and bash.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… is absent

prefer-describe-function-title calls getParserServices() without declaring
requiresTypeChecking, crashing ESLint when typed linting is not configured.
prefer-vi-mocked properly declares requiresTypeChecking but has the same
runtime failure. Both are sourced from configs.all and are now disabled
conditionally when no tsconfigPath is provided.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add sideEffects:false to textlint-config/package.json
- Exclude textlint rule packages from packem unused-dependency check;
  they are loaded at runtime by textlint via the generated .textlintrc,
  not statically imported in bin.ts
- Stage pnpm workspace reformatting (4→2 space indent) and new default
  catalog: section added by pnpm for @anolilab/eslint-config and
  @anolilab/prettier-config
- Migrate all affected packages to use catalog: references for those two
  workspace-internal packages

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@socket-security
Copy link

socket-security bot commented Feb 28, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​visulima/​packem@​2.0.0-alpha.36 ⏵ 2.0.0-alpha.3279 +4100100 +196 +1100
Addedeslint-plugin-tailwindcss@​3.18.29910010082100
Addedeslint-plugin-testing-library@​7.16.09910010094100

View full report

prisis and others added 2 commits February 28, 2026 21:57
…o catalog:lint

Replace the standalone default catalog: section (added by pnpm) with
proper named catalog entries under catalogs.lint, and update all
package.json references from "catalog:" to "catalog:lint".

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 28, 2026

Open in StackBlitz

browserslist-config-anolilab

npm i https://pkg.pr.new/anolilab/javascript-style-guide/browserslist-config-anolilab@1000

@anolilab/commitlint-config

npm i https://pkg.pr.new/anolilab/javascript-style-guide/@anolilab/commitlint-config@1000

@anolilab/eslint-config

npm i https://pkg.pr.new/anolilab/javascript-style-guide/@anolilab/eslint-config@1000

@anolilab/lint-staged-config

npm i https://pkg.pr.new/anolilab/javascript-style-guide/@anolilab/lint-staged-config@1000

@anolilab/prettier-config

npm i https://pkg.pr.new/anolilab/javascript-style-guide/@anolilab/prettier-config@1000

@anolilab/stylelint-config

npm i https://pkg.pr.new/anolilab/javascript-style-guide/@anolilab/stylelint-config@1000

@anolilab/textlint-config

npm i https://pkg.pr.new/anolilab/javascript-style-guide/@anolilab/textlint-config@1000

commit: d1409b6

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
packages/textlint-config/packem.config.ts (1)

17-45: Consider de-duplicating the runtime rule list to avoid drift.

This explicit exclude list works, but it’s easy for it to get out of sync with package.json. Consider centralizing this list in one constant/source (or generating it) so updates happen in one place.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/textlint-config/packem.config.ts` around lines 17 - 45, The explicit
rule list in dependencies.unused.exclude can drift from package.json; extract
the array into a single exported constant (e.g., RUNTIME_TEXTLINT_RULES) in a
shared module and import that constant where packem.config.ts currently defines
dependencies.unused.exclude, and also use it when generating/updating
package.json or .textlintrc so the same source-of-truth is reused; update any
build/generation code that previously duplicated the list to reference
RUNTIME_TEXTLINT_RULES instead.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@packages/textlint-config/packem.config.ts`:
- Around line 17-45: The explicit rule list in dependencies.unused.exclude can
drift from package.json; extract the array into a single exported constant
(e.g., RUNTIME_TEXTLINT_RULES) in a shared module and import that constant where
packem.config.ts currently defines dependencies.unused.exclude, and also use it
when generating/updating package.json or .textlintrc so the same source-of-truth
is reused; update any build/generation code that previously duplicated the list
to reference RUNTIME_TEXTLINT_RULES instead.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 870821a and dee7729.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (8)
  • packages/commitlint-config/package.json
  • packages/eslint-config/package.json
  • packages/eslint-config/src/config/plugins/vitest.ts
  • packages/lint-staged-config/package.json
  • packages/stylelint-config/package.json
  • packages/textlint-config/package.json
  • packages/textlint-config/packem.config.ts
  • pnpm-workspace.yaml

prisis and others added 2 commits February 28, 2026 22:14
… commitlint-config

- commitlint-config: sort files array alphabetically to satisfy jsonc/sort-array-values
- html.ts: replace indent.toString() with String(indent) to fix no-base-to-string
- promise.ts: cast plugin to typed interface before .configs access
- you-dont-need-lodash-underscore.ts: same — cast plugin and import Rules type
- combine.ts: wrap each config in Promise.resolve() to fix await-thenable
- interop-default.ts: replace (as any).default with Record<string,unknown> cast
  to eliminate no-unsafe-member-access and no-unsafe-return without eslint-disable
- prettier-types.ts: suppress operator-linebreak on vendor type alias

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…n configs

- Add missing module declarations for eslint-plugin-es-x, eslint-plugin-html,
  eslint-plugin-no-unsanitized, and eslint-plugin-react-perf in stub.d.ts
- Make mergePrettierOptions generic to propagate required parser property type
- Cast indent values to compatible types in html, stylistic, toml, unicorn, yml plugins
- Fix promise plugin to spread rules directly without fixupPluginRules wrapper
- Fix sonarjs plugin to handle array-typed recommended config using forEach loop
- Add null guards for storybook and tailwindcss plugin array access with type casts
- Fix react plugin jsx-runtime access with optional chaining and remove extra parens
- Fix index.ts getOverrides/getFiles with double-assertion cast to avoid TS2322
- Fix index.ts reactVersion/reactCompiler property name lookups in OptionsReact

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@prisis prisis merged commit aa8b26b into main Feb 28, 2026
21 of 24 checks passed
@prisis prisis deleted the fix/css-no-invalid-at-rules-tailwind-crash branch February 28, 2026 21:54
prisis pushed a commit that referenced this pull request Feb 28, 2026
…lab/eslint-config [22.0.2](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/eslint-config@22.0.1...@anolilab/eslint-config@22.0.2) (2026-02-28)

### Bug Fixes

* **eslint-config:** disable css/no-invalid-at-rules for Tailwind CSS … ([#1000](#1000)) ([aa8b26b](aa8b26b))
* **eslint-config:** disable react-refresh/only-export-components for TanStack and unicorn/no-null for JSX/TSX ([2d719a1](2d719a1))
prisis pushed a commit that referenced this pull request Feb 28, 2026
…nolilab/lint-staged-config [6.0.1](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/lint-staged-config@6.0.0...@anolilab/lint-staged-config@6.0.1) (2026-02-28)

### Bug Fixes

* **eslint-config:** disable css/no-invalid-at-rules for Tailwind CSS … ([#1000](#1000)) ([aa8b26b](aa8b26b))

### Dependencies

* **@anolilab/eslint-config:** upgraded to 22.0.2
prisis pushed a commit that referenced this pull request Feb 28, 2026
…lilab/textlint-config [12.1.2](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/textlint-config@12.1.1...@anolilab/textlint-config@12.1.2) (2026-02-28)

### Bug Fixes

* **eslint-config:** disable css/no-invalid-at-rules for Tailwind CSS … ([#1000](#1000)) ([aa8b26b](aa8b26b))
prisis pushed a commit that referenced this pull request Feb 28, 2026
…olilab/commitlint-config [9.1.1](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/commitlint-config@9.1.0...@anolilab/commitlint-config@9.1.1) (2026-02-28)

### Bug Fixes

* **eslint-config:** disable css/no-invalid-at-rules for Tailwind CSS … ([#1000](#1000)) ([aa8b26b](aa8b26b))

### Dependencies

* **@anolilab/eslint-config:** upgraded to 22.0.2
prisis pushed a commit that referenced this pull request Feb 28, 2026
…olilab/stylelint-config [10.1.1](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/stylelint-config@10.1.0...@anolilab/stylelint-config@10.1.1) (2026-02-28)

### Bug Fixes

* **eslint-config:** disable css/no-invalid-at-rules for Tailwind CSS … ([#1000](#1000)) ([aa8b26b](aa8b26b))

### Dependencies

* **@anolilab/eslint-config:** upgraded to 22.0.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant