feat(parse/css): add support for vue's v-bind() function#8846
Conversation
🦋 Changeset detectedLatest commit: badd49c The changes in this PR will be included in the next version bump. This PR includes changesets to release 14 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 |
CodSpeed Performance ReportMerging this PR will not alter performanceComparing Summary
Footnotes
|
WalkthroughAdds support for Vue's Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Comment |
735bdef to
3e2a7f4
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@crates/biome_css_analyze/src/keywords.rs`:
- Around line 770-774: The FUNCTION_KEYWORDS array is intended to be sorted but
currently places "v-bind" after "var", which fails the sorted-order test because
the hyphen sorts before "a"; move "v-bind" so it appears before "var" in the
FUNCTION_KEYWORDS list (i.e., ensure "v-bind" comes immediately before "var") to
restore correct lexical ordering.
In `@crates/biome_css_parser/src/syntax/value/function.rs`:
- Around line 27-31: The Vue v-bind function check is currently case-sensitive
and should accept any ASCII-case variation; update the matcher used in
is_at_vue_v_bind_function (the function that detects the "v-bind" functional
token) to compare names with eq_ignore_ascii_case() instead of a plain equality
check so that tokens like "V-BIND()" are treated the same as "v-bind()" and
routed to the Vue-only diagnostic path (leave other checks like
is_at_url_function, is_at_if_function, is_at_attr_function, is_at_function
unchanged).
| is_at_url_function(p) | ||
| || is_at_if_function(p) | ||
| || is_at_attr_function(p) | ||
| || is_at_vue_v_bind_function(p) | ||
| || is_at_function(p) |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
CSS specification function names case-insensitive CSS Syntax Values
💡 Result:
In the CSS specs, function names are (by default) ASCII case-insensitive for parsing/grammar matching.
- In CSS Syntax, the name of a
<function-token>is the ident sequence before the(, and when matching tokens against the grammar, “Unless otherwise specified, all matches are ASCII case-insensitive.” This applies to function tokens as well as ident tokens generally. [1] - The tokenizer also treats
"url"in an ASCII case-insensitive way when determining whetherurl(starts aurl-tokenvs afunction-token. [2]
Exception rule: if a particular feature/spec explicitly says otherwise, it can be case-sensitive (e.g., CSS Syntax notes that custom property names are case-sensitive). [1]
Sources:
[1] CSS Syntax Module Level 3 (Token/grammar matching rule; custom property note) (w3.org)
[2] CSS Syntax Module Level 3 (ident-like token / url case-insensitive check) (w3.org)
Citations:
🏁 Script executed:
# First, let's examine the file and the specific lines mentioned
cat -n crates/biome_css_parser/src/syntax/value/function.rs | head -100Repository: biomejs/biome
Length of output: 4490
Match v-bind case-insensitively.
CSS function names are case-insensitive per the CSS Syntax specification, so V-BIND() would currently bypass the Vue-only diagnostic path. The code uses a case-sensitive equality check where it should use eq_ignore_ascii_case().
🔧 Proposed fix
- let is_v_bind = p.cur_text() == "v-bind";
+ let is_v_bind = p.cur_text().eq_ignore_ascii_case("v-bind");🤖 Prompt for AI Agents
In `@crates/biome_css_parser/src/syntax/value/function.rs` around lines 27 - 31,
The Vue v-bind function check is currently case-sensitive and should accept any
ASCII-case variation; update the matcher used in is_at_vue_v_bind_function (the
function that detects the "v-bind" functional token) to compare names with
eq_ignore_ascii_case() instead of a plain equality check so that tokens like
"V-BIND()" are treated the same as "v-bind()" and routed to the Vue-only
diagnostic path (leave other checks like is_at_url_function, is_at_if_function,
is_at_attr_function, is_at_function unchanged).
3e2a7f4 to
badd49c
Compare
Summary
Adds support for Vue's
v-bind()function in CSS.Generated by gpt-5.2-codex
fixes #8692
Test Plan
added snapshots
Docs