Skip to content

Fixed Tailwind eslint config path resolution in all apps#26840

Merged
cmraible merged 3 commits intomainfrom
cmraible/fix-eslint-tailwind-config
Mar 17, 2026
Merged

Fixed Tailwind eslint config path resolution in all apps#26840
cmraible merged 3 commits intomainfrom
cmraible/fix-eslint-tailwind-config

Conversation

@cmraible
Copy link
Copy Markdown
Collaborator

@cmraible cmraible commented Mar 17, 2026

Summary

  • Fixed eslint-plugin-tailwindcss config path resolution in all apps that use it
  • Changed relative 'tailwind.config.cjs' to absolute ${__dirname}/tailwind.config.cjs using a tailwindConfig variable
  • Same fix as Shade (Fixed Tailwind eslint config path resolution in Shade #26821) — eslint-plugin-tailwindcss resolves config paths relative to CWD, not relative to .eslintrc.cjs. When lint-staged runs from the repo root, the plugin falls back to Tailwind defaults, producing different class orderings than when running eslint from the package directory.

Affected apps: admin-x-settings, posts, stats, activitypub, admin-x-design-system, signup-form, comments-ui

I strongly suspect that this fixes the tailwind classname ordering issue various people have seen when using VSCode's eslint.fixAll "codeActionOnSave" configuration. The problem fits the same pattern: if you open up VSCode to a particular app directly, there's no issue, but if you open VSCode in the monorepo root, you run into conflicts between the code action's module resolution and yarn lint's module resolution. Explicitly using the absolute path to the tailwind configuration should align the module resolution, regardless of which directory you've opened in VSCode.

Test plan

  • Run yarn lint from any affected app directory — should pass
  • Run npx eslint apps/<app>/src/ --no-cache from repo root — should produce same results as above

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 17, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 895b74bb-0af9-4e1c-a3a0-eaad66feade2

📥 Commits

Reviewing files that changed from the base of the PR and between 023d263 and fe2c9a2.

📒 Files selected for processing (2)
  • apps/comments-ui/package.json
  • apps/signup-form/package.json
✅ Files skipped from review due to trivial changes (1)
  • apps/comments-ui/package.json

Walkthrough

ESLint configs in apps (admin-x-settings, activitypub, admin-x-design-system, comments-ui, posts, signup-form, stats) now define a local tailwindConfig constant pointing to tailwind.config.cjs and replace literal 'tailwind.config.cjs' references with that variable for several Tailwind ESLint rules (tailwindcss/classnames-order, tailwindcss/enforces-negative-arbitrary-values, tailwindcss/enforces-shorthand, tailwindcss/migration-from-tailwind-2, and tailwindcss/no-contradicting-classname). Package versions were bumped: apps/activitypub 3.1.8→3.1.9, apps/comments-ui 1.3.11→1.3.12, and apps/signup-form 0.3.7→0.3.8.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: fixing Tailwind ESLint config path resolution across multiple apps by using absolute paths instead of relative paths.
Description check ✅ Passed The description is directly related to the changeset, providing clear context about the problem being fixed, the solution implemented, affected apps, and a test plan.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cmraible/fix-eslint-tailwind-config
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Same fix as Shade (#26821) — eslint-plugin-tailwindcss resolves config
paths relative to CWD, not relative to .eslintrc.cjs. Using __dirname
ensures correct resolution when lint-staged runs from repo root.
@cmraible cmraible force-pushed the cmraible/fix-eslint-tailwind-config branch from acdc2bd to 99745d4 Compare March 17, 2026 01:15
Same fix as Shade (#26821) and admin-x-settings — eslint-plugin-tailwindcss
resolves config paths relative to CWD, not relative to .eslintrc. Using
__dirname ensures correct resolution when lint-staged runs from repo root.

Affected apps: posts, stats, activitypub, admin-x-design-system,
signup-form, comments-ui
@cmraible cmraible changed the title Fixed Tailwind eslint config path resolution in admin-x-settings Fixed Tailwind eslint config path resolution in all apps Mar 17, 2026
@cmraible cmraible merged commit 29dc800 into main Mar 17, 2026
28 checks passed
@cmraible cmraible deleted the cmraible/fix-eslint-tailwind-config branch March 17, 2026 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant