Skip to content

docs(linter): document plugin rewrite fix behavior#3988

Open
chocky335 wants to merge 2 commits intobiomejs:nextfrom
chocky335:docs/plugin-rewrite-fix-kind
Open

docs(linter): document plugin rewrite fix behavior#3988
chocky335 wants to merge 2 commits intobiomejs:nextfrom
chocky335:docs/plugin-rewrite-fix-kind

Conversation

@chocky335
Copy link

Summary

Update plugin docs to match current GritQL plugin behavior from biomejs/biome#9073:

  • document that plugins can provide fixable rewrites via =>
  • document register_diagnostic(..., fix_kind = "safe" | "unsafe")
  • clarify --write vs --write --unsafe behavior for plugin rewrites
  • update supported plugin target languages to JavaScript, CSS, and JSON
  • add a cross-reference in the GritQL reference page to plugin rewrite fix behavior

@netlify
Copy link

netlify bot commented Feb 20, 2026

Deploy Preview for biomejs ready!

Name Link
🔨 Latest commit ee660fc
🔍 Latest deploy log https://app.netlify.com/projects/biomejs/deploys/699c8b89c66ee800086368ae
😎 Deploy Preview https://deploy-preview-3988--biomejs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 20, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 84c4887 and ee660fc.

📒 Files selected for processing (1)
  • src/content/docs/linter/plugins.mdx

Walkthrough

Documentation updates in two files to describe fixable diagnostics and rewrites for GritQL and linter plugins. The linter plugin docs add a fourth parameter to the public API: register_diagnostic(span, message, severity, fix_kind), with fix_kind indicating rewrite safety and defaulting to unsafe when omitted. Guidance clarifies the rewrite operator (=>), example usage, and how safe vs unsafe rewrites are applied (--write and --write --unsafe). The GritQL reference adds that patterns may include rewrites and references the linter plugin guidance.

Suggested reviewers

  • dyc3
  • siketyan
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: documenting plugin rewrite fix behaviour in the linter docs.
Description check ✅ Passed The description relates directly to the changeset, detailing the documentation updates for plugin rewrite behaviour and supported languages.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

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.

🧹 Nitpick comments (1)
src/content/docs/linter/plugins.mdx (1)

51-53: Optional: consider dropping the explicit language js directive for consistency.

The first example (the Object.assign one above) relies on the JavaScript default without declaring language js. Adding it here is harmless, but it's slightly inconsistent. Either align all JS examples to be explicit, or drop it here and rely on the documented default — your call.

✂️ Suggested change
 ```grit
-language js
-
 `console.log($msg)` as $call where {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/content/docs/linter/plugins.mdx` around lines 51 - 53, The code block
contains an explicit "language js" directive inside the grit code fence which is
inconsistent with the earlier Object.assign example that relies on the default;
remove the "language js" line from the code fence (so the block starts with
"```grit" and then the example `console.log($msg) as $call where {`) to match
the documented default, or alternatively make all JS examples explicit—pick one
approach and apply it consistently across the examples (target the code block
containing the `console.log($msg) as $call where {` snippet).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/content/docs/linter/plugins.mdx`:
- Around line 51-53: The code block contains an explicit "language js" directive
inside the grit code fence which is inconsistent with the earlier Object.assign
example that relies on the default; remove the "language js" line from the code
fence (so the block starts with "```grit" and then the example
`console.log($msg) as $call where {`) to match the documented default, or
alternatively make all JS examples explicit—pick one approach and apply it
consistently across the examples (target the code block containing the
`console.log($msg) as $call where {` snippet).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant