feat(migrate): more unsupported rule metadata for better clarity#8864
feat(migrate): more unsupported rule metadata for better clarity#8864
Conversation
🦋 Changeset detectedLatest commit: a5ea2c8 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 |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
04ec18c to
ad5f621
Compare
Parser conformance results onjs/262
jsx/babel
symbols/microsoft
ts/babel
ts/microsoft
|
ad5f621 to
841a4c7
Compare
44a85a6 to
a7f4f43
Compare
WalkthroughThis PR makes RuleSource lifetime-generic (RuleSource<'a>) and derives Copy, PartialEq, Eq and Hash. Display, ordering and URL/name generation were updated to be lifetime-aware and a const namespace() plus to_namespaced_rule_name() were added. The ESLint→Biome migration now records unsupported rules with explicit UnsupportedRuleReason variants (Stylistic, FormatterCovers, FormatterOption, KnownSourceNotImplemented, UnknownSource) and replaces the previous stylistic/unsupported sets with a BTreeMap of unsupported rules. A new unsupported_rules module exports a pre-sorted UNSUPPORTED_RULES constant and migration diagnostics were refactored to present a categorized breakdown of unsupported rules. Possibly related PRs
Suggested labels
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
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Fix all issues with AI agents
In @.changeset/smooth-sites-sip.md:
- Line 5: Update the changeset summary to use present tense: change the phrase
"will now specify a reason why a rule was not migrated" to present-tense wording
such as "specifies a reason why a rule was not migrated" (or "now specifies why
a rule was not migrated") and similarly adjust "It will now specify" to "It now
specifies" in the .changeset/smooth-sites-sip.md summary referencing the `biome
migrate eslint` behavior so the message conforms to project tense conventions.
In `@crates/biome_cli/src/execute/migrate/eslint_to_biome.rs`:
- Around line 258-266: Replace the typo in the log message passed to
visitor.record_log in the eslint_to_biome migration: change "so you don't loose
the functionality" to "so you don't lose the functionality" in the markup!
string used when formatter_covers is non-empty (the call site is the
visitor.record_log invocation that logs "These rules enforce behavior completely
covered by the formatter (so you don't loose the functionality):").
In `@crates/biome_cli/src/execute/migrate/unsupported_rules.rs`:
- Around line 8-10: Update the header comment above the UNSUPPORTED_RULES
constant to accurately reflect that the list contains rules from core ESLint
plus plugins (e.g., Jest, React, Stylistic, TypeScript, Vue) and that it remains
sorted for binary search; locate the constant named UNSUPPORTED_RULES and revise
its preceding comment to mention these plugin sources and the sorting rationale
so the intent is clear.
| // Sorted ESLint unsupported rules. | ||
| /// The array is sorted to allow binary search. | ||
| pub const UNSUPPORTED_RULES: &[UnsupportedRule] = &[ |
There was a problem hiding this comment.
Clarify the header comment to include plugin sources.
The list includes Jest/React/Stylistic/TypeScript/Vue rules too, so “ESLint” alone is a tad narrow.
✏️ Suggested tweak
-// Sorted ESLint unsupported rules.
+// Sorted ESLint and plugin unsupported rules.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| // Sorted ESLint unsupported rules. | |
| /// The array is sorted to allow binary search. | |
| pub const UNSUPPORTED_RULES: &[UnsupportedRule] = &[ | |
| // Sorted ESLint and plugin unsupported rules. | |
| /// The array is sorted to allow binary search. | |
| pub const UNSUPPORTED_RULES: &[UnsupportedRule] = &[ |
🤖 Prompt for AI Agents
In `@crates/biome_cli/src/execute/migrate/unsupported_rules.rs` around lines 8 -
10, Update the header comment above the UNSUPPORTED_RULES constant to accurately
reflect that the list contains rules from core ESLint plus plugins (e.g., Jest,
React, Stylistic, TypeScript, Vue) and that it remains sorted for binary search;
locate the constant named UNSUPPORTED_RULES and revise its preceding comment to
mention these plugin sources and the sorting rationale so the intent is clear.
...iome_cli/tests/snapshots/main_commands_migrate_eslint/migrate_eslint_config_packagejson.snap
Outdated
Show resolved
Hide resolved
a7f4f43 to
b2cf77d
Compare
...iome_cli/tests/snapshots/main_commands_migrate_eslint/migrate_eslint_config_packagejson.snap
Outdated
Show resolved
Hide resolved
...iome_cli/tests/snapshots/main_commands_migrate_eslint/migrate_eslint_config_packagejson.snap
Outdated
Show resolved
Hide resolved
b2cf77d to
8b00900
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@crates/biome_cli/src/execute/migrate/eslint_to_biome.rs`:
- Around line 131-170: The formatter_covers_count calculation incorrectly
includes UnsupportedRuleReason::Stylistic and
UnsupportedRuleReason::FormatterOption which inflates coverage; change the logic
in the computation of formatter_covers_count (the filter over self.unsupported)
to only count UnsupportedRuleReason::FormatterCovers, introduce separate
counters for Stylistic and FormatterOption (e.g., stylistic_count,
formatter_option_count) and then compute
total_migratable_count/total_covered_count/total_covered_percent using only the
appropriate buckets (exclude stylistic/formatter-option from "obsolete"
coverage), and update the user-facing messages that print
formatter_covers_count/total_covered_percent to reflect the new breakdown and
any mention of --include-inspired/--include-nursery behavior.
|
Also, I've just noticed that there are no tests for rules covered by the formatter. |
8b00900 to
a5ea2c8
Compare

Summary
This improves the migrate command to give better reasons for why a rule was not migrated. It also lets us mark rules from plugins as well. I'm hoping that this makes it easier for users to make informed decisions on if they switch to biome.
I did all the labeling by hand, but I had gpt-5.2-codex/opus 4.5 partially do some of the tedious stuff like adjusting the printing, and refactoring RuleSource to be more generic. There's a lot of rules and some of my decisions here might be inconsistent.
Here's what the summary at the top looks like (full diagnostic is too big for one screen):
The big change here is that we don't just tell the user how many rules have direct biome counterparts, but instead we show how many rules are covered by biome overall. Previously for this project, the migrate command would only show the user that only 24% of rules could be migrated, but that doesn't really paint the full picture.
Additionally, we now tell the user what formatter options cover which rules:
Test Plan
Tested manually on a couple open source projects.
Docs