Skip to content

chore: add extra eslint plugin sources#9362

Merged
Netail merged 3 commits intobiomejs:mainfrom
Netail:chore/new-eslint-plugins
Mar 6, 2026
Merged

chore: add extra eslint plugin sources#9362
Netail merged 3 commits intobiomejs:mainfrom
Netail:chore/new-eslint-plugins

Conversation

@Netail
Copy link
Copy Markdown
Member

@Netail Netail commented Mar 6, 2026

Summary

Add references to the eslint json plugin and 2 plugins for future usage

Test Plan

Docs

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 6, 2026

🦋 Changeset detected

Latest commit: afdf494

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-Linter Area: linter L-JSON Language: JSON and super languages labels Mar 6, 2026
@Netail Netail force-pushed the chore/new-eslint-plugins branch from c66c5fb to 49faba5 Compare March 6, 2026 09:44
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 6, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: deb9f1ed-f2f3-4e7c-a90b-b04edc593186

📥 Commits

Reviewing files that changed from the base of the PR and between 49faba5 and ba5367d.

📒 Files selected for processing (1)
  • crates/biome_analyze/src/rule.rs

Walkthrough

This PR adds three ESLint plugin rule sources to the RuleSource enum in crates/biome_analyze: EslintJson, EslintMarkdown, and EslintYml. It updates Display, variant_index, as_rule_name, namespace, and to_rule_url implementations to handle the new variants and their documentation URLs. Two JSON-related checks (useSortedKeys and NoDuplicateObjectKeys) are updated to reference the new EslintJson sources. No public API signatures besides the enum additions were changed.

Possibly related PRs

Suggested reviewers

  • ematipico
  • dyc3
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding support for three new ESLint plugin sources (JSON, Markdown, and YAML) to the RuleSource enum and related files.
Description check ✅ Passed The description relates to the changeset by mentioning the addition of eslint plugin references, though it's quite brief and lacks specific details about which plugins or implementation specifics.

✏️ 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

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

Copy link
Copy Markdown
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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
crates/biome_analyze/src/rule.rs (1)

299-305: ⚠️ Potential issue | 🟠 Major

variant_index has a duplicate value, which can break ordering guarantees.

Ord uses (variant_index, rule_name), but Eq also includes the variant. With duplicate indices, different variants can compare equal if rule names match.

🛠️ Proposed fix (make indices unique and sequential)
             Self::EslintTurbo(_) => 37,
             Self::HtmlEslint(_) => 38,
-            Self::EslintE18e(_) => 38,
-            Self::EslintBetterTailwindcss(_) => 39,
-            Self::EslintJson(_) => 40,
-            Self::EslintMarkdown(_) => 41,
-            Self::EslintYml(_) => 42,
+            Self::EslintE18e(_) => 39,
+            Self::EslintBetterTailwindcss(_) => 40,
+            Self::EslintJson(_) => 41,
+            Self::EslintMarkdown(_) => 42,
+            Self::EslintYml(_) => 43,
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@crates/biome_analyze/src/rule.rs` around lines 299 - 305, The variant_index
table contains duplicate numeric values (e.g., HtmlEslint and EslintE18e both at
38) which can violate ordering/equality guarantees used by the Ord/Eq
implementation; update the variant_index mapping in rule.rs so each enum variant
returns a unique, sequential index (adjust entries like Self::HtmlEslint,
Self::EslintE18e, Self::EslintBetterTailwindcss, Self::EslintJson,
Self::EslintMarkdown, Self::EslintYml, etc.) to ensure variant_index is strictly
increasing and consistent with the ordering logic used wherever variant_index is
referenced.
🧹 Nitpick comments (1)
.changeset/curly-laws-shout.md (1)

5-5: Make the summary more end-user facing.

“Extra rule source references” reads internal. A user-impact sentence would be clearer.

✍️ Suggested wording
-Extra rule source references. `biome migrate eslint` should do a bit better detecting rules in your eslint configurations.
+Improved `biome migrate eslint` so it detects more rules in ESLint configurations, including additional plugin sources.

As per coding guidelines: “Changeset descriptions must be written for end users (explain impact and what changed), not developers (avoid implementation details) in 1-3 sentences”.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.changeset/curly-laws-shout.md at line 5, Update the changeset summary
sentence that currently reads "Extra rule source references. `biome migrate
eslint` should do a bit better detecting rules in your eslint configurations."
to a clear, end-user facing 1–3 sentence description explaining the impact and
change (e.g., what users will see differently and what they should do),
replacing the internal phrasing "Extra rule source references" and keeping only
user-facing references to the `biome migrate eslint` behavior or user actions;
edit the single summary line in the changeset (.changeset/curly-laws-shout.md)
so it explains the user-visible effect and any recommended action in plain
language.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@crates/biome_analyze/src/rule.rs`:
- Around line 299-305: The variant_index table contains duplicate numeric values
(e.g., HtmlEslint and EslintE18e both at 38) which can violate ordering/equality
guarantees used by the Ord/Eq implementation; update the variant_index mapping
in rule.rs so each enum variant returns a unique, sequential index (adjust
entries like Self::HtmlEslint, Self::EslintE18e, Self::EslintBetterTailwindcss,
Self::EslintJson, Self::EslintMarkdown, Self::EslintYml, etc.) to ensure
variant_index is strictly increasing and consistent with the ordering logic used
wherever variant_index is referenced.

---

Nitpick comments:
In @.changeset/curly-laws-shout.md:
- Line 5: Update the changeset summary sentence that currently reads "Extra rule
source references. `biome migrate eslint` should do a bit better detecting rules
in your eslint configurations." to a clear, end-user facing 1–3 sentence
description explaining the impact and change (e.g., what users will see
differently and what they should do), replacing the internal phrasing "Extra
rule source references" and keeping only user-facing references to the `biome
migrate eslint` behavior or user actions; edit the single summary line in the
changeset (.changeset/curly-laws-shout.md) so it explains the user-visible
effect and any recommended action in plain language.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7a6351e9-0c2c-4213-99a4-a8b384a7ee8c

📥 Commits

Reviewing files that changed from the base of the PR and between 35d2c33 and 49faba5.

📒 Files selected for processing (4)
  • .changeset/curly-laws-shout.md
  • crates/biome_analyze/src/rule.rs
  • crates/biome_json_analyze/src/assist/source/use_sorted_keys.rs
  • crates/biome_json_analyze/src/lint/suspicious/no_duplicate_object_keys.rs

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Mar 6, 2026

Merging this PR will not alter performance

✅ 15 untouched benchmarks
⏩ 196 skipped benchmarks1


Comparing Netail:chore/new-eslint-plugins (afdf494) with main (2a29e0d)2

Open in CodSpeed

Footnotes

  1. 196 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.

  2. No successful run was found on main (35d2c33) during the generation of this report, so 2a29e0d was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@github-actions github-actions Bot added the A-CLI Area: CLI label Mar 6, 2026
@Netail Netail merged commit fc9ca4c into biomejs:main Mar 6, 2026
18 checks passed
@Netail Netail deleted the chore/new-eslint-plugins branch March 6, 2026 10:16
@github-actions github-actions Bot mentioned this pull request Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CLI Area: CLI A-Linter Area: linter L-JSON Language: JSON and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants