Skip to content

Commit

Permalink
fix(migrate-eslint): correctly resolve shared config @scope/eslint-co…
Browse files Browse the repository at this point in the history
…nfig (#2713)
  • Loading branch information
Conaclos authored May 4, 2024
1 parent cb0182e commit 24f06ed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ our [guidelines for writing a good changelog entry](https://github.com/biomejs/b

Contributed by @tasshi-me

- `biome migrate eslint` now correctly resolve `@scope/eslint-config` ([#2705](https://github.com/biomejs/biome/issues/2705)). Contributed by @Conaclos

### Configuration

### Editors
Expand Down
3 changes: 1 addition & 2 deletions crates/biome_cli/src/execute/migrate/eslint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,11 +370,10 @@ impl EslintPackage {
EslintPackage::Config => "eslint-config-",
EslintPackage::Plugin => "eslint-plugin-",
};
debug_assert!(matches!(artifact, "eslint-plugin-" | "eslint-config-"));
if name.starts_with('@') {
// handle scoped module
if let Some((scope, scoped)) = name.split_once('/') {
if scoped.starts_with(artifact) {
if scoped.starts_with(artifact) || scoped == artifact.trim_end_matches('-') {
Cow::Borrowed(name)
} else {
Cow::Owned(format!("{scope}/{artifact}{scoped}"))
Expand Down

0 comments on commit 24f06ed

Please sign in to comment.