fix(tailwind): parse non inline configuration variables#3466
Merged
dielduarte merged 7 commits intocanaryfrom May 4, 2026
Merged
fix(tailwind): parse non inline configuration variables#3466dielduarte merged 7 commits intocanaryfrom
dielduarte merged 7 commits intocanaryfrom
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 561fdc3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
Contributor
There was a problem hiding this comment.
1 issue found across 4 files
Confidence score: 3/5
- Potential wrong Tailwind config resolution in
packages/ui/src/utils/caniemail/tailwind/get-tailwind-config.tswhen identifiers are reused could lead to incorrect styling behavior. - Score reflects a concrete, user-facing risk (severity 7/10) but limited in scope to config lookup logic.
- Pay close attention to
packages/ui/src/utils/caniemail/tailwind/get-tailwind-config.ts- identifier-based lookup isn’t scope-aware and may bind the wrong variable.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/ui/src/utils/caniemail/tailwind/get-tailwind-config.ts">
<violation number="1" location="packages/ui/src/utils/caniemail/tailwind/get-tailwind-config.ts:137">
P1: Identifier-based Tailwind config lookup is not scope-aware, so it can bind to the wrong variable when names are reused.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
gabrielmfern
reviewed
May 4, 2026
gabrielmfern
reviewed
May 4, 2026
gabrielmfern
reviewed
May 4, 2026
gabrielmfern
reviewed
May 4, 2026
gabrielmfern
approved these changes
May 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
getTailwindConfig only handled cases where the prop was an inline object literal. If the config was stored in a variable (e.g., const config = { ... }; ), it failed to parse it.
The Fix: When the config prop value is an Identifier (a variable reference), a new findVariableInitializer helper traverses the AST to locate that variable's declaration and extract its source code, then uses that as the config value.
Summary by cubic
Fixes Tailwind config parsing when the
configprop uses a variable instead of an inline object. The compatibility check now resolves the variable initializer from the right scope (even with shadowed names), addressing DEV-361.configidentifiers with scope-aware AST binding and extract the initializer source; keep parsing local (avoid shared helper).confignames; addbiome-ignoreto allow intentional shadowing in the fixture.Written for commit 561fdc3. Summary will update on new commits.