Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@dyc3
Copy link
Contributor

@dyc3 dyc3 commented Oct 25, 2025

Summary

The css parser is now able to parse @plugin declarations that have options blocks.

fixes #7860

Test Plan

added parser and formatter tests

Docs

@changeset-bot
Copy link

changeset-bot bot commented Oct 25, 2025

🦋 Changeset detected

Latest commit: d585314

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 13 packages
Name Type
@biomejs/biome Patch
@biomejs/cli-win32-x64 Patch
@biomejs/cli-win32-arm64 Patch
@biomejs/cli-darwin-x64 Patch
@biomejs/cli-darwin-arm64 Patch
@biomejs/cli-linux-x64 Patch
@biomejs/cli-linux-arm64 Patch
@biomejs/cli-linux-x64-musl Patch
@biomejs/cli-linux-arm64-musl Patch
@biomejs/wasm-web Patch
@biomejs/wasm-bundler Patch
@biomejs/wasm-nodejs Patch
@biomejs/backend-jsonrpc Patch

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

@github-actions github-actions bot added A-Parser Area: parser A-Formatter Area: formatter A-Tooling Area: internal tools L-CSS Language: CSS L-Grit Language: GritQL labels Oct 25, 2025
@dyc3 dyc3 force-pushed the dyc3/fix-tw-plugin-options branch from 02420ba to 1c010b4 Compare October 25, 2025 15:19
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 25, 2025

Walkthrough

This change updates the Tailwind @plugin grammar, parser and formatter to accept an optional inline declaration block in addition to the existing semicolon-only form. The AST/grammar now includes an optional block field for TwPluginAtRule, the parser will parse a declaration block when no trailing semicolon is present, the formatter conditionally prints the block and semicolon, and tests for valid and error cases are added.

Possibly related PRs

Suggested reviewers

  • ematipico

Pre-merge checks and finishing touches

✅ Passed checks (4 passed)
Check name Status Explanation
Title Check ✅ Passed The title "fix(parse/css): allow @plugin to accept options" directly and clearly describes the primary change in the pull request. It accurately reflects that the CSS parser has been modified to handle @plugin declarations with options blocks, which is the core objective. The title uses conventional commit format, is concise, and is specific enough for scanning PR history.
Linked Issues Check ✅ Passed The changes comprehensively address the objectives from issue #7860. The parser grammar has been updated to accept optional declaration blocks in @plugin directives [xtask/codegen/css.ungram], the parser logic has been modified to handle this new syntax [crates/biome_css_parser/src/syntax/at_rule/tailwind.rs], and the formatter has been updated accordingly [crates/biome_css_formatter/src/tailwind/statements/plugin_at_rule.rs]. Test cases have been added for both valid syntax (plugin-with-options.css, plugin-with-options-2.css, plugin-no-options.css) and error cases (plugin-with-invalid-options.css, plugin-with-invalid-options-2.css), validating the implementation against the reported issue.
Out of Scope Changes Check ✅ Passed The vast majority of changes are directly scoped to the @plugin options feature fix. All grammar, parser, formatter, and test changes relate to the core objective. However, the documentation comments added to generic Parser trait methods in crates/biome_parser/src/lib.rs (eat, eat_ts, eat_ts_with_context) are tangential to the @plugin fix and appear to be unrelated utility improvements, though they are purely documentation with no functional impact.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dyc3/fix-tw-plugin-options

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f5d68f7 and d585314.

⛔ Files ignored due to path filters (12)
  • crates/biome_css_factory/src/generated/node_factory.rs is excluded by !**/generated/**, !**/generated/** and included by **
  • crates/biome_css_factory/src/generated/syntax_factory.rs is excluded by !**/generated/**, !**/generated/** and included by **
  • crates/biome_css_formatter/tests/specs/css/tailwind/plugin-no-options.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_formatter/tests/specs/css/tailwind/plugin-with-options.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/plugin-with-invalid-options-2.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/plugin-with-invalid-options.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/tailwind/plugin-with-options-2.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/tailwind/plugin-with-options.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/tailwind/plugin.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/tailwind/shadcn-default.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_syntax/src/generated/nodes.rs is excluded by !**/generated/**, !**/generated/** and included by **
  • crates/biome_css_syntax/src/generated/nodes_mut.rs is excluded by !**/generated/**, !**/generated/** and included by **
📒 Files selected for processing (12)
  • .changeset/small-sides-teach.md (1 hunks)
  • crates/biome_css_formatter/src/tailwind/statements/plugin_at_rule.rs (1 hunks)
  • crates/biome_css_formatter/tests/specs/css/tailwind/plugin-no-options.css (1 hunks)
  • crates/biome_css_formatter/tests/specs/css/tailwind/plugin-with-options.css (1 hunks)
  • crates/biome_css_parser/src/syntax/at_rule/tailwind.rs (3 hunks)
  • crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/plugin-with-invalid-options-2.css (1 hunks)
  • crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/plugin-with-invalid-options.css (1 hunks)
  • crates/biome_css_parser/tests/css_test_suite/ok/tailwind/plugin-with-options-2.css (1 hunks)
  • crates/biome_css_parser/tests/css_test_suite/ok/tailwind/plugin-with-options.css (1 hunks)
  • crates/biome_grit_patterns/src/grit_target_language/css_target_language/constants.rs (1 hunks)
  • crates/biome_parser/src/lib.rs (3 hunks)
  • xtask/codegen/css.ungram (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (7)
  • crates/biome_css_formatter/tests/specs/css/tailwind/plugin-no-options.css
  • crates/biome_css_parser/tests/css_test_suite/ok/tailwind/plugin-with-options-2.css
  • crates/biome_css_parser/tests/css_test_suite/ok/tailwind/plugin-with-options.css
  • crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/plugin-with-invalid-options-2.css
  • crates/biome_css_formatter/tests/specs/css/tailwind/plugin-with-options.css
  • crates/biome_css_parser/src/syntax/at_rule/tailwind.rs
  • crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/plugin-with-invalid-options.css
🧰 Additional context used
📓 Path-based instructions (5)
.changeset/*.md

📄 CodeRabbit inference engine (CONTRIBUTING.md)

.changeset/*.md: In changesets, only use #### or ##### headers; other header levels are not allowed
Changesets should cover user-facing changes only; internal changes do not need changesets
Use past tense for what you did and present tense for current Biome behavior in changesets
When fixing a bug in a changeset, start with an issue link (e.g., “Fixed #1234: …”)
When referencing a rule or assist in a changeset, include a link to its page on the website
Include code blocks in changesets when applicable to illustrate changes
End every sentence in a changeset with a period

Files:

  • .changeset/small-sides-teach.md
crates/biome_*/**

📄 CodeRabbit inference engine (CLAUDE.md)

Place core crates under /crates/biome_*/

Files:

  • crates/biome_grit_patterns/src/grit_target_language/css_target_language/constants.rs
  • crates/biome_css_formatter/src/tailwind/statements/plugin_at_rule.rs
  • crates/biome_parser/src/lib.rs
**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.rs: Format Rust files before committing (e.g., via just f which formats Rust)
Document rules, assists, and options with inline rustdoc in source

Files:

  • crates/biome_grit_patterns/src/grit_target_language/css_target_language/constants.rs
  • crates/biome_css_formatter/src/tailwind/statements/plugin_at_rule.rs
  • crates/biome_parser/src/lib.rs
xtask/codegen/*.ungram

📄 CodeRabbit inference engine (CLAUDE.md)

Define and modify language grammars in .ungram files; ASTs are generated from these

Files:

  • xtask/codegen/css.ungram
crates/biome_*_{syntax,parser,formatter,analyze,factory,semantic}/**

📄 CodeRabbit inference engine (CLAUDE.md)

Maintain the per-language crate structure: biome_{lang}_{syntax,parser,formatter,analyze,factory,semantic}

Files:

  • crates/biome_css_formatter/src/tailwind/statements/plugin_at_rule.rs
🧬 Code graph analysis (1)
crates/biome_css_formatter/src/tailwind/statements/plugin_at_rule.rs (2)
crates/biome_css_syntax/src/generated/nodes.rs (15)
  • plugin_token (7137-7139)
  • semicolon_token (347-349)
  • semicolon_token (1553-1555)
  • semicolon_token (1684-1686)
  • semicolon_token (2234-2236)
  • semicolon_token (2788-2790)
  • semicolon_token (3444-3446)
  • semicolon_token (6489-6491)
  • semicolon_token (6624-6626)
  • semicolon_token (6912-6914)
  • semicolon_token (6957-6959)
  • semicolon_token (7051-7053)
  • semicolon_token (7146-7148)
  • semicolon_token (7192-7194)
  • semicolon_token (7241-7243)
crates/biome_formatter/src/builders.rs (1)
  • space (606-608)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
  • GitHub Check: Documentation
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: autofix
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Check Dependencies
  • GitHub Check: Test Node.js API
  • GitHub Check: Bench (biome_json_formatter)
  • GitHub Check: Bench (biome_css_analyze)
  • GitHub Check: Bench (biome_json_analyze)
  • GitHub Check: Bench (biome_json_parser)
  • GitHub Check: Bench (biome_css_formatter)
  • GitHub Check: Bench (biome_css_parser)
  • GitHub Check: Bench (biome_js_parser)
  • GitHub Check: Bench (biome_js_analyze)
  • GitHub Check: Bench (biome_js_formatter)
  • GitHub Check: Bench (biome_graphql_parser)
  • GitHub Check: Parser conformance
  • GitHub Check: Bench (biome_graphql_formatter)
🔇 Additional comments (6)
crates/biome_grit_patterns/src/grit_target_language/css_target_language/constants.rs (1)

6-9: LGTM—generated code reflects the grammar change.

The new entry for TW_PLUGIN_AT_RULE at slot 3 aligns with the optional block field in the updated grammar.

crates/biome_parser/src/lib.rs (3)

391-401: LGTM—helpful documentation addition.

Clarifies return semantics for token consumption methods.


404-414: LGTM—helpful documentation addition.

Clarifies return semantics for token consumption methods.


417-434: LGTM—helpful documentation addition.

Clarifies return semantics for token consumption methods.

.changeset/small-sides-teach.md (1)

1-5: LGTM—changeset follows guidelines.

Properly formatted with issue link, past tense, and period.

crates/biome_css_formatter/src/tailwind/statements/plugin_at_rule.rs (1)

16-26: Formatter logic assumes valid input but grammar doesn't guarantee it.

The formatter correctly handles:

  • Block + semicolon → normalise to block only (removes semicolon)
  • Semicolon only → preserve semicolon

However, the else branch at line 23 assumes semicolon_token exists when block is None. Since the grammar currently permits both to be absent, this could format invalid syntax. Once the grammar is fixed (as noted in css.ungram), this implementation will be sound.

The normalisation behaviour (removing semicolons after blocks) aligns with CSS conventions.


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

@github-actions
Copy link
Contributor

Parser conformance results on

js/262

Test result main count This PR count Difference
Total 50762 50762 0
Passed 49558 49558 0
Failed 1162 1162 0
Panics 42 42 0
Coverage 97.63% 97.63% 0.00%

jsx/babel

Test result main count This PR count Difference
Total 40 40 0
Passed 37 37 0
Failed 3 3 0
Panics 0 0 0
Coverage 92.50% 92.50% 0.00%

symbols/microsoft

Test result main count This PR count Difference
Total 6316 6316 0
Passed 2105 2105 0
Failed 4211 4211 0
Panics 0 0 0
Coverage 33.33% 33.33% 0.00%

ts/babel

Test result main count This PR count Difference
Total 835 835 0
Passed 742 742 0
Failed 93 93 0
Panics 0 0 0
Coverage 88.86% 88.86% 0.00%

ts/microsoft

Test result main count This PR count Difference
Total 18805 18805 0
Passed 14057 14057 0
Failed 4747 4747 0
Panics 1 1 0
Coverage 74.75% 74.75% 0.00%

@codspeed-hq
Copy link

codspeed-hq bot commented Oct 25, 2025

CodSpeed Performance Report

Merging #7866 will not alter performance

Comparing dyc3/fix-tw-plugin-options (d585314) with main (fe90c78)

Summary

✅ 53 untouched
⏩ 85 skipped1

Footnotes

  1. 85 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

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

Let's not forget to add failing test cases for classic CSS

@dyc3
Copy link
Contributor Author

dyc3 commented Oct 25, 2025

There's already a test for flagging @plugin when the option is disabled. Is this insufficient? https://github.com/biomejs/biome/blob/main/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-disabled/plugin.css.snap

I know it technically doesn't have options present, but I feel like we already cover all the behavior.

@dyc3 dyc3 force-pushed the dyc3/fix-tw-plugin-options branch from 1c010b4 to f5d68f7 Compare October 25, 2025 16:26
Copy link
Contributor

@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.

Actionable comments posted: 2

🧹 Nitpick comments (1)
crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/plugin-with-invalid-options-2.css (1)

1-8: Negative case looks right

Catches rules inside @plugin, which should be declarations-only. Consider adding another invalid case with a nested at-rule (e.g., @media {}) inside the plugin block to cover both branches.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1c010b4 and f5d68f7.

⛔ Files ignored due to path filters (12)
  • crates/biome_css_factory/src/generated/node_factory.rs is excluded by !**/generated/**, !**/generated/** and included by **
  • crates/biome_css_factory/src/generated/syntax_factory.rs is excluded by !**/generated/**, !**/generated/** and included by **
  • crates/biome_css_formatter/tests/specs/css/tailwind/plugin-no-options.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_formatter/tests/specs/css/tailwind/plugin-with-options.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/plugin-with-invalid-options-2.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/plugin-with-invalid-options.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/tailwind/plugin-with-options-2.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/tailwind/plugin-with-options.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/tailwind/plugin.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/tailwind/shadcn-default.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_syntax/src/generated/nodes.rs is excluded by !**/generated/**, !**/generated/** and included by **
  • crates/biome_css_syntax/src/generated/nodes_mut.rs is excluded by !**/generated/**, !**/generated/** and included by **
📒 Files selected for processing (12)
  • .changeset/small-sides-teach.md (1 hunks)
  • crates/biome_css_formatter/src/tailwind/statements/plugin_at_rule.rs (1 hunks)
  • crates/biome_css_formatter/tests/specs/css/tailwind/plugin-no-options.css (1 hunks)
  • crates/biome_css_formatter/tests/specs/css/tailwind/plugin-with-options.css (1 hunks)
  • crates/biome_css_parser/src/syntax/at_rule/tailwind.rs (3 hunks)
  • crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/plugin-with-invalid-options-2.css (1 hunks)
  • crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/plugin-with-invalid-options.css (1 hunks)
  • crates/biome_css_parser/tests/css_test_suite/ok/tailwind/plugin-with-options-2.css (1 hunks)
  • crates/biome_css_parser/tests/css_test_suite/ok/tailwind/plugin-with-options.css (1 hunks)
  • crates/biome_grit_patterns/src/grit_target_language/css_target_language/constants.rs (1 hunks)
  • crates/biome_parser/src/lib.rs (3 hunks)
  • xtask/codegen/css.ungram (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (8)
  • crates/biome_parser/src/lib.rs
  • crates/biome_grit_patterns/src/grit_target_language/css_target_language/constants.rs
  • crates/biome_css_formatter/src/tailwind/statements/plugin_at_rule.rs
  • crates/biome_css_parser/tests/css_test_suite/ok/tailwind/plugin-with-options-2.css
  • crates/biome_css_parser/tests/css_test_suite/ok/tailwind/plugin-with-options.css
  • crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/plugin-with-invalid-options.css
  • .changeset/small-sides-teach.md
  • crates/biome_css_formatter/tests/specs/css/tailwind/plugin-no-options.css
🧰 Additional context used
📓 Path-based instructions (5)
xtask/codegen/*.ungram

📄 CodeRabbit inference engine (CLAUDE.md)

Define and modify language grammars in .ungram files; ASTs are generated from these

Files:

  • xtask/codegen/css.ungram
crates/biome_*_{syntax,parser,formatter,analyze,factory,semantic}/**

📄 CodeRabbit inference engine (CLAUDE.md)

Maintain the per-language crate structure: biome_{lang}_{syntax,parser,formatter,analyze,factory,semantic}

Files:

  • crates/biome_css_formatter/tests/specs/css/tailwind/plugin-with-options.css
  • crates/biome_css_parser/src/syntax/at_rule/tailwind.rs
  • crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/plugin-with-invalid-options-2.css
crates/biome_*/**

📄 CodeRabbit inference engine (CLAUDE.md)

Place core crates under /crates/biome_*/

Files:

  • crates/biome_css_formatter/tests/specs/css/tailwind/plugin-with-options.css
  • crates/biome_css_parser/src/syntax/at_rule/tailwind.rs
  • crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/plugin-with-invalid-options-2.css
**/tests/**

📄 CodeRabbit inference engine (CLAUDE.md)

Place test files under a tests/ directory in each crate

Files:

  • crates/biome_css_formatter/tests/specs/css/tailwind/plugin-with-options.css
  • crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/plugin-with-invalid-options-2.css
**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.rs: Format Rust files before committing (e.g., via just f which formats Rust)
Document rules, assists, and options with inline rustdoc in source

Files:

  • crates/biome_css_parser/src/syntax/at_rule/tailwind.rs
🧬 Code graph analysis (1)
crates/biome_css_parser/src/syntax/at_rule/tailwind.rs (1)
crates/biome_css_parser/src/syntax/block/declaration_or_rule_list_block.rs (1)
  • parse_declaration_or_rule_list_block (19-21)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
  • GitHub Check: Bench (biome_css_formatter)
  • GitHub Check: Bench (biome_css_parser)
  • GitHub Check: Bench (biome_css_analyze)
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Documentation
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Check Dependencies
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Bench (biome_js_formatter)
  • GitHub Check: Bench (biome_js_analyze)
  • GitHub Check: Bench (biome_js_parser)
  • GitHub Check: Bench (biome_graphql_parser)
  • GitHub Check: autofix
  • GitHub Check: Test Node.js API
  • GitHub Check: Bench (biome_graphql_formatter)
  • GitHub Check: Bench (biome_json_formatter)
  • GitHub Check: Parser conformance
  • GitHub Check: Bench (biome_json_analyze)
  • GitHub Check: Bench (biome_json_parser)
🔇 Additional comments (2)
crates/biome_css_formatter/tests/specs/css/tailwind/plugin-with-options.css (1)

1-4: Good fixture; please add two companions

  • Add a variant with a trailing semicolon after the block to exercise the optional ';'.
  • Add a variant using a custom property in options (e.g., --my-variable: "Favourite variable";) to mirror the issue report.
crates/biome_css_parser/src/syntax/at_rule/tailwind.rs (1)

3-5: Import change is fine

parse_declaration_block is the right choice to enforce declarations-only.

Comment on lines 1970 to +1977
'plugin'
name: CssString
';'
block: AnyCssDeclarationBlock?
';'?
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Tighten the TwPluginAtRule to disallow the “nothing after name” form

Current rule makes both block and ';' optional, inadvertently allowing @plugin "x" (no block, no semicolon). Require one of them, but still allow ';' after a block.

Apply this diff:

-TwPluginAtRule =
-  'plugin'
-  name: CssString
-  block: AnyCssDeclarationBlock?
-  ';'?
+TwPluginAtRule =
+  'plugin'
+  name: CssString
+  ( block: AnyCssDeclarationBlock ';'? | ';' )

This matches the intended surface and the parser change above. Regenerate codegen after updating.

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
xtask/codegen/css.ungram around lines 1974-1977: the TwPluginAtRule currently
makes both 'block' and ';' optional which permits a bare name with neither
(e.g., @plugin "x"); change the rule so that at least one of them is required —
i.e., allow either a block (optionally followed by a semicolon) or a standalone
semicolon, but disallow the case with neither; update the grammar accordingly
and then regenerate codegen after the change.

Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

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

We should add a test case where the plugin block has semicolon

@plugin "my-plugin" {
	debug: false;
	threshold: 0.5;
};

@dyc3 dyc3 force-pushed the dyc3/fix-tw-plugin-options branch from f5d68f7 to d585314 Compare October 26, 2025 13:16
@dyc3 dyc3 merged commit 7b2600b into main Oct 26, 2025
26 checks passed
@dyc3 dyc3 deleted the dyc3/fix-tw-plugin-options branch October 26, 2025 15:30
@github-actions github-actions bot mentioned this pull request Oct 26, 2025
Jagget pushed a commit to Jagget/biome that referenced this pull request Oct 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Formatter Area: formatter A-Parser Area: parser A-Tooling Area: internal tools L-CSS Language: CSS L-Grit Language: GritQL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 CSS parser with tailwindDirectives does not parse @plugin w/ parameters, biome 1.3.0

3 participants