Skip to content

chore: missing rule source#9871

Merged
Netail merged 1 commit intomainfrom
chore/missing-rule-source
Apr 8, 2026
Merged

chore: missing rule source#9871
Netail merged 1 commit intomainfrom
chore/missing-rule-source

Conversation

@Netail
Copy link
Copy Markdown
Member

@Netail Netail commented Apr 8, 2026

Summary

Added another rule source

As it's inspired, it will not include an eslint migration path, so mainly just docs and thus no changeset needed

Test Plan

Docs

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 8, 2026

⚠️ No Changeset found

Latest commit: 0ac078d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions Bot added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages labels Apr 8, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 8, 2026

Walkthrough

Added a new enum variant RuleSource::EslintTypescriptSortKeys(&'a str) and wired it into RuleSource methods: Display, as_rule_name, namespace, and to_rule_url now handle the new variant. The ESLint-to-Biome mapping (TryFrom<&EslintRuleName> for RuleSource<'a>) recognises the typescript-sort-keys source. The UseSortedInterfaceMembers rule metadata now includes RuleSource::EslintTypescriptSortKeys("interface").inspired() alongside the existing Perfectionist source.

Possibly related PRs

  • #9547: Modifies the same RuleSource<'a> enum and updates rule source metadata by adding eslint-plugin variants and related method adjustments.

Suggested reviewers

  • dyc3
  • ematipico
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'chore: missing rule source' directly relates to the changeset, which adds a new RuleSource variant for TypeScript-sort-keys support across multiple files.
Description check ✅ Passed The description accurately describes the change as adding another rule source that is inspired (without ESLint migration) and notes it is documentation-focused with no changeset needed.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/missing-rule-source

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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@crates/biome_analyze/src/rule.rs`:
- Around line 195-196: Add the missing match arm for the new enum variant so
migrations recognize the typescript-sort-keys plugin: in the match statement
that maps ESLint plugin names to RuleSource inside migrate/eslint_to_biome.rs,
add a branch for the string "typescript-sort-keys" that returns
RuleSource::EslintTypescriptSortKeys (the enum variant EslintTypescriptSortKeys
defined in rule.rs) so the new variant is reachable during migration.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: bf28e7ce-2471-4f8b-a640-3026e4cd83e3

📥 Commits

Reviewing files that changed from the base of the PR and between e8cad58 and 693e572.

📒 Files selected for processing (2)
  • crates/biome_analyze/src/rule.rs
  • crates/biome_js_analyze/src/assist/source/use_sorted_interface_members.rs

Comment thread crates/biome_analyze/src/rule.rs
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 8, 2026

Merging this PR will not alter performance

✅ 58 untouched benchmarks
⏩ 196 skipped benchmarks1


Comparing chore/missing-rule-source (0ac078d) with main (e8cad58)

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.

@Netail Netail force-pushed the chore/missing-rule-source branch from 693e572 to 0ac078d Compare April 8, 2026 20:07
@github-actions github-actions Bot added the A-CLI Area: CLI label Apr 8, 2026
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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@crates/biome_cli/src/execute/migrate/eslint_to_biome.rs`:
- Line 405: Add a migration snapshot test that asserts the new mapping for
"typescript-sort-keys" resolves to RuleSource::EslintTypescriptSortKeys; locate
the existing migration snapshot test suite for the eslint_to_biome migration
(look for tests that use the migration runner or snapshot helpers) and add a
case that imports a rule path like "typescript-sort-keys/<rule>" and captures
the resulting resolved mapping, then add the expected snapshot (or update the
snapshot generator) so CI will verify that typescript-sort-keys routes through
the new branch.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2207f06c-2f12-42dd-a224-c879e2b6ae13

📥 Commits

Reviewing files that changed from the base of the PR and between 693e572 and 0ac078d.

📒 Files selected for processing (3)
  • crates/biome_analyze/src/rule.rs
  • crates/biome_cli/src/execute/migrate/eslint_to_biome.rs
  • crates/biome_js_analyze/src/assist/source/use_sorted_interface_members.rs
✅ Files skipped from review due to trivial changes (2)
  • crates/biome_js_analyze/src/assist/source/use_sorted_interface_members.rs
  • crates/biome_analyze/src/rule.rs

Some("vue") => RuleSource::EslintVueJs,
Some("turbo") => RuleSource::EslintTurbo,
Some("@html-eslint") => RuleSource::HtmlEslint,
Some("typescript-sort-keys") => RuleSource::EslintTypescriptSortKeys,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify whether a migrator spec already covers `typescript-sort-keys`
# Expected: at least one match under migrate_eslint specs or nearby tests.

rg -n --iglob '*.{json,jsonc,rs}' 'typescript-sort-keys|EslintTypescriptSortKeys'

Repository: biomejs/biome

Length of output: 1208


🏁 Script executed:

fd -t f . tests/specs/migrate_eslint/ | head -20

Repository: biomejs/biome

Length of output: 171


🏁 Script executed:

rg -t json 'typescript-sort-keys' tests/specs/migrate_eslint/ -l

Repository: biomejs/biome

Length of output: 124


🏁 Script executed:

fd -t f migrate_eslint tests/

Repository: biomejs/biome

Length of output: 150


🏁 Script executed:

fd -t d migrate tests/

Repository: biomejs/biome

Length of output: 150


🏁 Script executed:

git ls-files | grep -i migrate | head -20

Repository: biomejs/biome

Length of output: 1084


🏁 Script executed:

git ls-files | grep -i test | grep -i eslint | head -20

Repository: biomejs/biome

Length of output: 2011


🏁 Script executed:

rg -n 'typescript-sort-keys' crates/biome_cli/tests/commands/migrate_eslint.rs

Repository: biomejs/biome

Length of output: 39


🏁 Script executed:

rg -n 'typescript-sort-keys' crates/biome_cli/tests/snapshots/main_commands_migrate_eslint/

Repository: biomejs/biome

Length of output: 39


🏁 Script executed:

cat crates/biome_cli/tests/snapshots/main_commands_migrate_eslint/migrate_eslintrcjson.snap | head -50

Repository: biomejs/biome

Length of output: 1172


Add a migration snapshot test for typescript-sort-keys

Line 405 correctly wires the new source mapping, but there's no snapshot test confirming that typescript-sort-keys/<rule> resolves through this branch. Per coding guidelines, all Rust changes need appropriate tests—a migration snapshot covering this rule would catch regressions.

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

In `@crates/biome_cli/src/execute/migrate/eslint_to_biome.rs` at line 405, Add a
migration snapshot test that asserts the new mapping for "typescript-sort-keys"
resolves to RuleSource::EslintTypescriptSortKeys; locate the existing migration
snapshot test suite for the eslint_to_biome migration (look for tests that use
the migration runner or snapshot helpers) and add a case that imports a rule
path like "typescript-sort-keys/<rule>" and captures the resulting resolved
mapping, then add the expected snapshot (or update the snapshot generator) so CI
will verify that typescript-sort-keys routes through the new branch.

@Netail Netail merged commit 9993cdb into main Apr 8, 2026
29 checks passed
@Netail Netail deleted the chore/missing-rule-source branch April 8, 2026 20:33
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-JavaScript Language: JavaScript and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants