Support prefixed custom CSS imports#20274
Conversation
Allow `prefix(...)` on imported custom CSS files to scope `@utility` definitions from that import. Custom utilities from prefixed imports now use the public `prefix:utility` candidate format without making that prefix global for core utilities. Imported utility roots are tracked per prefix to avoid exposing unrelated utilities that happen to share the same internal name prefix. Adds coverage for: - custom imports inheriting the Tailwind import prefix - custom imports using their own prefix - prefixed custom imports not prefixing core utilities - avoiding collisions with unrelated `prefix-*` utilities
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThe changes add import-prefix tracking for utilities, record imported utility roots during AST walking, and use that information to remap and filter parsed candidates. 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/tailwindcss/src/index.ts`:
- Around line 636-639: The imported-utility candidate override in
designSystem.parseCandidate still lets the internal hyphenated form bypass the
prefix remap and reach parseCandidate(candidate), so ui-card or tw:ui-card can
resolve under the internal name. Update the fallback path in the parseCandidate
wrapper to filter out imported utility roots that were registered via
importedUtilityRootsByPrefix, and ensure the same check is applied in the later
matching branch near the second parseCandidate handling so only the public
prefix form is accepted.
- Around line 536-538: The nested `@theme` handling in index.ts is incorrectly
propagating prefix(...) from imported custom theme blocks into the global
theme.prefix, which can make core utilities unexpectedly require a custom
prefix. Update the logic around the `@theme` and `@utility` walk/processing so
prefix propagation only happens for imports that actually contain Tailwind
utilities (for example, guarded by containsTailwindUtilities), and ensure the
later `@theme` handler only sets theme.prefix for those Tailwind utility imports.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: d21dc37a-cb76-4ff5-85b7-be1f4ba2cbe9
📒 Files selected for processing (2)
packages/tailwindcss/src/index.tspackages/tailwindcss/src/prefix.test.ts
Confidence Score: 5/5The change is safe to merge; all previously-flagged regressions are addressed and tested. The variant-shadowing bug raised in prior review threads is now fixed by the fallback in parseCandidateWithoutImportedRoots, and the new test suite (including the prefix(sm) breakpoint-collision case) confirms correct behaviour. The parseCandidateWithoutImportedRoots filter in index.ts (lines 645-650) is worth a second look for the flat-union naming-conflict edge case. Reviews (3): Last reviewed commit: "Merge branch 'main' into feat/import-pre..." | Re-trigger Greptile |
Here is everything you need to know about this update. Please take a good look at what changed and the test results before merging this pull request. ### What changed? #### ✳️ eslint (9.37.0 → 9.39.1) · [Repo](https://github.com/eslint/eslint) · [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) <details> <summary>Release Notes</summary> <h4><a href="https://github.com/eslint/eslint/releases/tag/v9.39.1">9.39.1</a></h4> <blockquote><h2 dir="auto">Bug Fixes</h2> <ul dir="auto"> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/650753ee3976784343ceb40170619dab1aa9fe0d"><code class="notranslate">650753e</code></a> fix: Only pass node to JS lang visitor methods (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20283">#20283</a>) (Nicholas C. Zakas)</li> </ul> <h2 dir="auto">Documentation</h2> <ul dir="auto"> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/51b51f4f1ce82ef63264c4e45d9ef579bcd73f8e"><code class="notranslate">51b51f4</code></a> docs: add a section on when to use extends vs cascading (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20268">#20268</a>) (Tanuj Kanti)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/b44d42699dcd1729b7ecb50ca70e4c1c17f551f1"><code class="notranslate">b44d426</code></a> docs: Update README (GitHub Actions Bot)</li> </ul> <h2 dir="auto">Chores</h2> <ul dir="auto"> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/92db329211c8da5ce8340a4d4c05ce9c12845381"><code class="notranslate">92db329</code></a> chore: update <code class="notranslate">@eslint/js</code> version to 9.39.1 (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20284">#20284</a>) (Francesco Trotta)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/c7ebefc9eaf99b76b30b0d3cf9960807a47367c4"><code class="notranslate">c7ebefc</code></a> chore: package.json update for @eslint/js release (Jenkins)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/61778f6ca33c0f63962a91d6a75a4fa5db9f47d2"><code class="notranslate">61778f6</code></a> chore: update eslint-config-eslint dependency @eslint/js to ^9.39.0 (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20275">#20275</a>) (renovate[bot])</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/d9ca2fcd9ad63331bfd329a69534e1ff04f231e8"><code class="notranslate">d9ca2fc</code></a> ci: Add rangeStrategy to eslint group in renovate config (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20266">#20266</a>) (唯然)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/009e5076ff5a4bd845f55e17676e3bb88f47c280"><code class="notranslate">009e507</code></a> test: fix version tests for ESLint v10 (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20274">#20274</a>) (Milos Djermanovic)</li> </ul></blockquote> <h4><a href="https://github.com/eslint/eslint/releases/tag/v9.39.0">9.39.0</a></h4> <blockquote><h2 dir="auto">Features</h2> <ul dir="auto"> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/cc57d87a3f119e9d39c55e044e526ae067fa31ce"><code class="notranslate">cc57d87</code></a> feat: update error loc to key in <code class="notranslate">no-dupe-class-members</code> (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20259">#20259</a>) (Tanuj Kanti)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/126552fcf35da3ddcefa527db06dabc54c04041c"><code class="notranslate">126552f</code></a> feat: update error location in <code class="notranslate">for-direction</code> and <code class="notranslate">no-dupe-args</code> (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20258">#20258</a>) (Tanuj Kanti)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/167d0970d3802a66910e9820f31dcd717fab0b2a"><code class="notranslate">167d097</code></a> feat: update <code class="notranslate">complexity</code> rule to highlight only static block header (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20245">#20245</a>) (jaymarvelz)</li> </ul> <h2 dir="auto">Bug Fixes</h2> <ul dir="auto"> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/15f5c7c168d0698683943f51dd617f14a5e6815c"><code class="notranslate">15f5c7c</code></a> fix: forward traversal <code class="notranslate">step.args</code> to visitors (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20253">#20253</a>) (jaymarvelz)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/5a1a534e877f7c4c992885867f923df307c3929d"><code class="notranslate">5a1a534</code></a> fix: allow JSDoc comments in object-shorthand rule (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20167">#20167</a>) (Nitin Kumar)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/e86b813eb660f1a5adc8e143a70d9b683cd12362"><code class="notranslate">e86b813</code></a> fix: Use more types from @eslint/core (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20257">#20257</a>) (Nicholas C. Zakas)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/927272d1f0d5683b029b729d368a96527f283323"><code class="notranslate">927272d</code></a> fix: correct <code class="notranslate">Scope</code> typings (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20198">#20198</a>) (jaymarvelz)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/37f76d9c539bb6fc816fedb7be4486b71a58620a"><code class="notranslate">37f76d9</code></a> fix: use <code class="notranslate">AST.Program</code> type for Program node (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20244">#20244</a>) (Francesco Trotta)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/ae07f0b3334ebd22ae2e7b09bca5973b96aa9768"><code class="notranslate">ae07f0b</code></a> fix: unify timing report for concurrent linting (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20188">#20188</a>) (jaymarvelz)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/b165d471be6062f4475b972155b02654a974a0e9"><code class="notranslate">b165d47</code></a> fix: correct <code class="notranslate">Rule</code> typings (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20199">#20199</a>) (jaymarvelz)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/fb97cda70d87286a7dbd2457f578ef578d6905e8"><code class="notranslate">fb97cda</code></a> fix: improve error message for missing fix function in suggestions (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20218">#20218</a>) (jaymarvelz)</li> </ul> <h2 dir="auto">Documentation</h2> <ul dir="auto"> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/d3e81e30ee6be5a21151b7a17ef10a714b6059c0"><code class="notranslate">d3e81e3</code></a> docs: Always recommend to include a files property (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20158">#20158</a>) (Percy Ma)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/0f0385f1404dcadaba4812120b1ad02334dbd66a"><code class="notranslate">0f0385f</code></a> docs: use consistent naming recommendation (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20250">#20250</a>) (Alex M. Spieslechner)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/a3b145609ac649fac837c8c0515cbb2a9321ca40"><code class="notranslate">a3b1456</code></a> docs: Update README (GitHub Actions Bot)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/cf5f2dd58dd98084a21da04fe7b9054b9478d552"><code class="notranslate">cf5f2dd</code></a> docs: fix correct tag of <code class="notranslate">no-useless-constructor</code> (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20255">#20255</a>) (Tanuj Kanti)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/10b995c8e5473de8d66d3cd99d816e046f35e3ec"><code class="notranslate">10b995c</code></a> docs: add TS options and examples for <code class="notranslate">nofunc</code> in <code class="notranslate">no-use-before-define</code> (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20249">#20249</a>) (Tanuj Kanti)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/2584187e4a305ea7a98e1a5bd4dca2a60ad132f8"><code class="notranslate">2584187</code></a> docs: remove repetitive word in comment (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20242">#20242</a>) (reddaisyy)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/637216bd4f2aae7c928ad04a4e40eecffb50c9e5"><code class="notranslate">637216b</code></a> docs: update CLI flags migration instructions (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20238">#20238</a>) (jaymarvelz)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/e7cda3bdf1bdd664e6033503a3315ad81736b200"><code class="notranslate">e7cda3b</code></a> docs: Update README (GitHub Actions Bot)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/7b9446f7cc2054aa2cdf8e6225f4ac15a03671a8"><code class="notranslate">7b9446f</code></a> docs: handle empty flags sections on the feature flags page (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20222">#20222</a>) (sethamus)</li> </ul> <h2 dir="auto">Chores</h2> <ul dir="auto"> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/dfe3c1b2034228765c48c8a445554223767dd16d"><code class="notranslate">dfe3c1b</code></a> chore: update <code class="notranslate">@eslint/js</code> version to 9.39.0 (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20270">#20270</a>) (Francesco Trotta)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/2375a6de8263393c129d41cac1b407b40111a73c"><code class="notranslate">2375a6d</code></a> chore: package.json update for @eslint/js release (Jenkins)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/a1f4e52d67c94bef61edd1607dcd130047c1baf0"><code class="notranslate">a1f4e52</code></a> chore: update <code class="notranslate">@eslint</code> dependencies (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20265">#20265</a>) (Francesco Trotta)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/c7d32298482752eeac9fb46378d4f1ea095f3836"><code class="notranslate">c7d3229</code></a> chore: update dependency @eslint/core to ^0.17.0 (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20256">#20256</a>) (renovate[bot])</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/27549bc774c7c2dc5c569070a3e87c62f602bf7d"><code class="notranslate">27549bc</code></a> chore: update fuzz testing to not error if code sample minimizer fails (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20252">#20252</a>) (Milos Djermanovic)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/a1370ee40e9d8e0e41843f3278cd745fc1ad543f"><code class="notranslate">a1370ee</code></a> ci: bump actions/setup-node from 5 to 6 (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20230">#20230</a>) (dependabot[bot])</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/9e7fad4a1867709060686d03e0ec1d0d69671cfb"><code class="notranslate">9e7fad4</code></a> chore: add script to auto-generate eslint:recommended configuration (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20208">#20208</a>) (唯然)</li> </ul></blockquote> <h4><a href="https://github.com/eslint/eslint/releases/tag/v9.38.0">9.38.0</a></h4> <blockquote><h2 dir="auto">Features</h2> <ul dir="auto"> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/ce40f74efd45f66d9fbfc6f78ce622ee72008485"><code class="notranslate">ce40f74</code></a> feat: update <code class="notranslate">complexity</code> rule to only highlight function header (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20048">#20048</a>) (Atul Nair)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/e37e590aae2a7fcca4d3a9adc1379ad466e5c5d1"><code class="notranslate">e37e590</code></a> feat: correct <code class="notranslate">no-loss-of-precision</code> false positives with <code class="notranslate">e</code> notation (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20187">#20187</a>) (Francesco Trotta)</li> </ul> <h2 dir="auto">Bug Fixes</h2> <ul dir="auto"> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/50c3dfd98065622765a51a8ddb1e70c44fc5a4cb"><code class="notranslate">50c3dfd</code></a> fix: improve type support for isolated dependencies in pnpm (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20201">#20201</a>) (Francesco Trotta)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/a1f06a350c4155c4dbf39bf932a38d71d70f1b65"><code class="notranslate">a1f06a3</code></a> fix: correct SourceCode typings (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20114">#20114</a>) (Pixel998)</li> </ul> <h2 dir="auto">Documentation</h2> <ul dir="auto"> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/462675af8a811f9ca984efaedbdc5b46b13ced7a"><code class="notranslate">462675a</code></a> docs: improve web accessibility by hiding non-semantic character (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20205">#20205</a>) (루밀LuMir)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/c070e65f6bb9e38d06a89ba2b3261781bec3d397"><code class="notranslate">c070e65</code></a> docs: correct formatting in <code class="notranslate">no-irregular-whitespace</code> rule documentation (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20203">#20203</a>) (루밀LuMir)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/b39e71a2130ae1ea3fbc19b19f5b951eb625722a"><code class="notranslate">b39e71a</code></a> docs: Update README (GitHub Actions Bot)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/cd3998314876a4fad6463d9011bc73778ccc1fd9"><code class="notranslate">cd39983</code></a> docs: move <code class="notranslate">custom-formatters</code> type descriptions to <code class="notranslate">nodejs-api</code> (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20190">#20190</a>) (Percy Ma)</li> </ul> <h2 dir="auto">Chores</h2> <ul dir="auto"> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/d17c795bf1624e0604998482b98e6bb6bff39045"><code class="notranslate">d17c795</code></a> chore: upgrade @eslint/js@9.38.0 (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20221">#20221</a>) (Milos Djermanovic)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/25d0e33270e08baed09dbee2cdd56a8e5cd9da0f"><code class="notranslate">25d0e33</code></a> chore: package.json update for @eslint/js release (Jenkins)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/c82b5efa1fc91900e029efa23e688fad67fc17fa"><code class="notranslate">c82b5ef</code></a> refactor: Use types from @eslint/core (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20168">#20168</a>) (Nicholas C. Zakas)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/ff31609f195654d448954210ba4d31e921d463e8"><code class="notranslate">ff31609</code></a> ci: add Node.js 25 to <code class="notranslate">ci.yml</code> (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20220">#20220</a>) (루밀LuMir)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/004577eda2f2f4b2829e0364f8b41893cebfc859"><code class="notranslate">004577e</code></a> ci: bump github/codeql-action from 3 to 4 (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20211">#20211</a>) (dependabot[bot])</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/eac71fb77113de7bf199ff20c6ee44cefcb59848"><code class="notranslate">eac71fb</code></a> test: remove use of <code class="notranslate">nodejsScope</code> option of eslint-scope from tests (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20206">#20206</a>) (Milos Djermanovic)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/4168a18b7efd8facbbd71cd44a62942a9f656a30"><code class="notranslate">4168a18</code></a> chore: fix typo in legacy-eslint.js (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20202">#20202</a>) (Sweta Tanwar)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/205dbd2d9272e761574c478e3b0181f7b89ed0f6"><code class="notranslate">205dbd2</code></a> chore: fix typos (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20200">#20200</a>) (ntnyq)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/dbb200e3604e63bba23a18d40089ca44604835ed"><code class="notranslate">dbb200e</code></a> chore: use team member's username when name is not available in data (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20194">#20194</a>) (Milos Djermanovic)</li> <li> <a href="https://bounce.depfu.com/github.com/eslint/eslint/commit/8962089edbd978b43513576387a134036b8e2d36"><code class="notranslate">8962089</code></a> chore: mark deprecated rules as available until v11.0.0 (<a href="https://bounce.depfu.com/github.com/eslint/eslint/pull/20184">#20184</a>) (Pixel998)</li> </ul></blockquote> <p><em>Does any of this look wrong? <a href="https://depfu.com/packages/npm/eslint/feedback">Please let us know.</a></em></p> </details> <details> <summary>Commits</summary> <p><a href="https://github.com/eslint/eslint/compare/d5d1bdf5fdfad75197aadd3e894182135158c3b1...e2772811a8595d161870835ff04822b25a2cdf45">See the full diff on Github</a>. The new version differs by 59 commits:</p> <ul> <li><a href="https://github.com/eslint/eslint/commit/e2772811a8595d161870835ff04822b25a2cdf45"><code>9.39.1</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/4cdf397b30b2b749865ea0fcf4d30eb8ba458896"><code>Build: changelog update for 9.39.1</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/92db329211c8da5ce8340a4d4c05ce9c12845381"><code>chore: update `@eslint/js` version to 9.39.1 (tailwindlabs#20284)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/c7ebefc9eaf99b76b30b0d3cf9960807a47367c4"><code>chore: package.json update for @eslint/js release</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/650753ee3976784343ceb40170619dab1aa9fe0d"><code>fix: Only pass node to JS lang visitor methods (tailwindlabs#20283)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/51b51f4f1ce82ef63264c4e45d9ef579bcd73f8e"><code>docs: add a section on when to use extends vs cascading (tailwindlabs#20268)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/61778f6ca33c0f63962a91d6a75a4fa5db9f47d2"><code>chore: update eslint-config-eslint dependency @eslint/js to ^9.39.0 (tailwindlabs#20275)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/d9ca2fcd9ad63331bfd329a69534e1ff04f231e8"><code>ci: Add rangeStrategy to eslint group in renovate config (#20266)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/009e5076ff5a4bd845f55e17676e3bb88f47c280"><code>test: fix version tests for ESLint v10 (tailwindlabs#20274)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/b44d42699dcd1729b7ecb50ca70e4c1c17f551f1"><code>docs: Update README</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/ac3a60dffc29d8d4d5031621bc062e77f891532a"><code>9.39.0</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/e79017ff52cada700e743110bd17409f41f4fdfa"><code>Build: changelog update for 9.39.0</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/dfe3c1b2034228765c48c8a445554223767dd16d"><code>chore: update `@eslint/js` version to 9.39.0 (tailwindlabs#20270)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/2375a6de8263393c129d41cac1b407b40111a73c"><code>chore: package.json update for @eslint/js release</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/d3e81e30ee6be5a21151b7a17ef10a714b6059c0"><code>docs: Always recommend to include a files property (tailwindlabs#20158)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/15f5c7c168d0698683943f51dd617f14a5e6815c"><code>fix: forward traversal `step.args` to visitors (tailwindlabs#20253)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/5a1a534e877f7c4c992885867f923df307c3929d"><code>fix: allow JSDoc comments in object-shorthand rule (tailwindlabs#20167)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/cc57d87a3f119e9d39c55e044e526ae067fa31ce"><code>feat: update error loc to key in `no-dupe-class-members` (tailwindlabs#20259)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/a1f4e52d67c94bef61edd1607dcd130047c1baf0"><code>chore: update `@eslint` dependencies (#20265)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/e86b813eb660f1a5adc8e143a70d9b683cd12362"><code>fix: Use more types from @eslint/core (tailwindlabs#20257)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/126552fcf35da3ddcefa527db06dabc54c04041c"><code>feat: update error location in `for-direction` and `no-dupe-args` (tailwindlabs#20258)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/927272d1f0d5683b029b729d368a96527f283323"><code>fix: correct `Scope` typings (tailwindlabs#20198)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/c7d32298482752eeac9fb46378d4f1ea095f3836"><code>chore: update dependency @eslint/core to ^0.17.0 (tailwindlabs#20256)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/0f0385f1404dcadaba4812120b1ad02334dbd66a"><code>docs: use consistent naming recommendation (tailwindlabs#20250)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/a3b145609ac649fac837c8c0515cbb2a9321ca40"><code>docs: Update README</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/37f76d9c539bb6fc816fedb7be4486b71a58620a"><code>fix: use `AST.Program` type for Program node (tailwindlabs#20244)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/cf5f2dd58dd98084a21da04fe7b9054b9478d552"><code>docs: fix correct tag of `no-useless-constructor` (tailwindlabs#20255)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/27549bc774c7c2dc5c569070a3e87c62f602bf7d"><code>chore: update fuzz testing to not error if code sample minimizer fails (tailwindlabs#20252)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/10b995c8e5473de8d66d3cd99d816e046f35e3ec"><code>docs: add TS options and examples for `nofunc` in `no-use-before-define` (tailwindlabs#20249)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/167d0970d3802a66910e9820f31dcd717fab0b2a"><code>feat: update `complexity` rule to highlight only static block header (tailwindlabs#20245)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/2584187e4a305ea7a98e1a5bd4dca2a60ad132f8"><code>docs: remove repetitive word in comment (tailwindlabs#20242)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/ae07f0b3334ebd22ae2e7b09bca5973b96aa9768"><code>fix: unify timing report for concurrent linting (tailwindlabs#20188)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/b165d471be6062f4475b972155b02654a974a0e9"><code>fix: correct `Rule` typings (tailwindlabs#20199)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/637216bd4f2aae7c928ad04a4e40eecffb50c9e5"><code>docs: update CLI flags migration instructions (tailwindlabs#20238)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/e7cda3bdf1bdd664e6033503a3315ad81736b200"><code>docs: Update README</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/a1370ee40e9d8e0e41843f3278cd745fc1ad543f"><code>ci: bump actions/setup-node from 5 to 6 (tailwindlabs#20230)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/fb97cda70d87286a7dbd2457f578ef578d6905e8"><code>fix: improve error message for missing fix function in suggestions (tailwindlabs#20218)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/9e7fad4a1867709060686d03e0ec1d0d69671cfb"><code>chore: add script to auto-generate eslint:recommended configuration (tailwindlabs#20208)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/7b9446f7cc2054aa2cdf8e6225f4ac15a03671a8"><code>docs: handle empty flags sections on the feature flags page (tailwindlabs#20222)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/8fe511b4c0fb74df3290271b29c672c3fbf3be1f"><code>9.38.0</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/f961736693e8b5658eb117eedbb9754be589c0ce"><code>Build: changelog update for 9.38.0</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/d17c795bf1624e0604998482b98e6bb6bff39045"><code>chore: upgrade @eslint/js@9.38.0 (tailwindlabs#20221)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/25d0e33270e08baed09dbee2cdd56a8e5cd9da0f"><code>chore: package.json update for @eslint/js release</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/50c3dfd98065622765a51a8ddb1e70c44fc5a4cb"><code>fix: improve type support for isolated dependencies in pnpm (tailwindlabs#20201)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/c82b5efa1fc91900e029efa23e688fad67fc17fa"><code>refactor: Use types from @eslint/core (tailwindlabs#20168)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/ff31609f195654d448954210ba4d31e921d463e8"><code>ci: add Node.js 25 to `ci.yml` (tailwindlabs#20220)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/ce40f74efd45f66d9fbfc6f78ce622ee72008485"><code>feat: update `complexity` rule to only highlight function header (tailwindlabs#20048)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/e37e590aae2a7fcca4d3a9adc1379ad466e5c5d1"><code>feat: correct `no-loss-of-precision` false positives with `e` notation (tailwindlabs#20187)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/004577eda2f2f4b2829e0364f8b41893cebfc859"><code>ci: bump github/codeql-action from 3 to 4 (tailwindlabs#20211)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/eac71fb77113de7bf199ff20c6ee44cefcb59848"><code>test: remove use of `nodejsScope` option of eslint-scope from tests (tailwindlabs#20206)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/462675af8a811f9ca984efaedbdc5b46b13ced7a"><code>docs: improve web accessibility by hiding non-semantic character (tailwindlabs#20205)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/c070e65f6bb9e38d06a89ba2b3261781bec3d397"><code>docs: correct formatting in `no-irregular-whitespace` rule documentation (tailwindlabs#20203)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/b39e71a2130ae1ea3fbc19b19f5b951eb625722a"><code>docs: Update README</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/4168a18b7efd8facbbd71cd44a62942a9f656a30"><code>chore: fix typo in legacy-eslint.js (#20202)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/205dbd2d9272e761574c478e3b0181f7b89ed0f6"><code>chore: fix typos (tailwindlabs#20200)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/a1f06a350c4155c4dbf39bf932a38d71d70f1b65"><code>fix: correct SourceCode typings (tailwindlabs#20114)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/dbb200e3604e63bba23a18d40089ca44604835ed"><code>chore: use team member&tailwindlabs#39;s username when name is not available in data (tailwindlabs#20194)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/cd3998314876a4fad6463d9011bc73778ccc1fd9"><code>docs: move `custom-formatters` type descriptions to `nodejs-api` (tailwindlabs#20190)</code></a></li> <li><a href="https://github.com/eslint/eslint/commit/8962089edbd978b43513576387a134036b8e2d36"><code>chore: mark deprecated rules as available until v11.0.0 (tailwindlabs#20184)</code></a></li> </ul> </details> ---  [Depfu](https://depfu.com) will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with `@depfu rebase`. <details><summary>All Depfu comment commands</summary> <blockquote><dl> <dt>@depfu rebase</dt><dd>Rebases against your default branch and redoes this update</dd> <dt>@depfu recreate</dt><dd>Recreates this PR, overwriting any edits that you've made to it</dd> <dt>@depfu merge</dt><dd>Merges this PR once your tests are passing and conflicts are resolved</dd> <dt>@depfu cancel merge</dt><dd>Cancels automatic merging of this PR</dd> <dt>@depfu close</dt><dd>Closes this PR and deletes the branch</dd> <dt>@depfu reopen</dt><dd>Restores the branch and reopens this PR (if it's closed)</dd> <dt>@depfu pause</dt><dd>Ignores all future updates for this dependency and closes this PR</dd> <dt>@depfu pause [minor|major]</dt><dd>Ignores all future minor/major updates for this dependency and closes this PR</dd> <dt>@depfu resume</dt><dd>Future versions of this dependency will create PRs again (leaves this PR as is)</dd> </dl></blockquote> </details> Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
Summary
This PR makes
prefix(...)work for custom CSS imports that define@utilityrules.Why?
Developing libraries on top of Tailwind CSS may requires the users to use prefixes to avoid conflicts.
If 2 different imported libraries have the same class name, it should be possible to prefix one of them to avoid conflict.
in above code, if
lib1andlib2have same utility class names, and both are 3rd party libraries, we need a way to avoid this conflict.Example:
For example, a custom import like:
where
components.csscontains:can now generate the utility using the prefixed candidate:
The prefix is scoped to utilities imported from that file, so it does not prefix core utilities or expose unrelated utilities that happen to use the same internal name prefix.
This also preserves the existing behavior where
@import "tailwindcss" prefix(tw);configures the global Tailwind prefix.Test plan
All tests passing
Checked formatting:
Example:
Imported file:
button.css
Before this PR:
style.css
Result:
buttonstyle.css
Result:
tw:buttonstyle.css
Result:
tw:buttonAfter this PR:
style.css
✅ Same result:
buttonstyle.css
✅ Same result:
tw:buttonstyle.css
🆕 Result:
Now the custom imported file can have its own prefix.
ui:buttonI assume this won't be a breaking change since it does not change existing behavior, and
@import "./button" prefix(ui);was not doing anything and was never documented.Please let me know if anything needs to be changed.