chore: add extra eslint plugin sources#9362
Conversation
🦋 Changeset detectedLatest commit: afdf494 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 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 |
c66c5fb to
49faba5
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThis PR adds three ESLint plugin rule sources to the RuleSource enum in crates/biome_analyze: Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
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_indexhas a duplicate value, which can break ordering guarantees.
Orduses(variant_index, rule_name), butEqalso 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
📒 Files selected for processing (4)
.changeset/curly-laws-shout.mdcrates/biome_analyze/src/rule.rscrates/biome_json_analyze/src/assist/source/use_sorted_keys.rscrates/biome_json_analyze/src/lint/suspicious/no_duplicate_object_keys.rs
Merging this PR will not alter performance
Comparing Footnotes
|
Summary
Add references to the eslint json plugin and 2 plugins for future usage
Test Plan
Docs