Skip to content

Commit

Permalink
refactor: tldr migratation guide & noUnusedImports ref in import sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
Conaclos committed Apr 29, 2024
1 parent ca68b92 commit 15addf2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion biome
Submodule biome updated 203 files
11 changes: 0 additions & 11 deletions codegen/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/content/docs/analyzer/import-sorting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ This feature is enabled by default but can be opted-out via configuration:
}
```

:::note
The import sorter doesn't remove unused imports.
We provide the linter rule [noUnusedImports](https://biomejs.dev/linter/rules/no-unused-imports/) with a safe fix that removes unused imports.
:::

## How imports are sorted

Import statements are sorted by "distance". Modules that are "farther" from the user are put on the top, modules "closer" to the user are put on the bottom:
Expand Down
7 changes: 7 additions & 0 deletions src/content/docs/guides/migrate-eslint-prettier.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ import PackageManagerBiomeCommand from "@/components/PackageManagerBiomeCommand.

Biome provides dedicated commands to ease the migration from ESLint and Prettier.

If you don't want to know the details, just run the following commands:

```shell
biome migrate eslint --write
biome migrate prettier --write
```

## Migrate from ESLint

Many Biome linter rules are inspired by or identical to the ESLint rules or the rules of an ESLint plugin.
Expand Down

0 comments on commit 15addf2

Please sign in to comment.