Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: introduce the configure-biome guide #811

Merged
merged 2 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,15 @@ export default defineConfig({
"pt-BR": "Instalação manual",
},
},
{
label: "Configure Biome",
link: "/guides/configure-biome",
translations: {
ja: "バイオームの設定",
"zh-CN": "配置生物群落",
"pt-BR": "Configurar Bioma",
},
},
{
label: "Use Biome in big projects",
link: "/guides/big-projects",
Expand All @@ -87,15 +96,6 @@ export default defineConfig({
"pt-BR": "Usando o Biome em projetos grandes",
},
},
{
label: "How Biome works",
link: "/guides/how-biome-works",
translations: {
ja: "Biome の振る舞い",
"zh-CN": "Biome 工作原理",
"pt-BR": "Como o Biome funciona",
},
},
{
label: "Biome in your IDE",
translations: {
Expand Down
2 changes: 1 addition & 1 deletion src/content/blog/biome-v1-7.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ The following rules are promoted:

- You can now ignore `React` imports in the rules [noUnusedImports](/linter/rules/no-unused-imports/#options) and [useImportType](/linter/rules/use-import-type/#options) by setting [`javascript.jsxRuntime`](/reference/configuration/#javascriptjsxruntime) to `reactClassic`.

- Biome applies specific settings to [well-known files](/guides/how-biome-works/#well-known-files).
- Biome applies specific settings to [well-known files](/guides/configure-biome/#well-known-files).
It now recognizes more files and distinguishes between JSON files that only allow comments and JSON files that allow both comments and trailing commas.

- In the React ecosystem, files ending in `.js` are allowed to contain JSX syntax.
Expand Down
32 changes: 4 additions & 28 deletions src/content/docs/formatter/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ For more information about all the available options, check the [CLI reference](
Biome provides some options to tune the behavior of its formatter.
Differently from other tools, Biome separates language-agnostic options from language-specific options.

The formatter options can be set on the [CLI](/reference/cli/#biome-format) or via a [Biome configuration file](/guides/how-biome-works/#configuration).
The formatter options can be set on the [CLI](/reference/cli/#biome-format) or via a [Biome configuration file](/guides/configure-biome).
Biome doesn't support `.editorconfig` [yet](https://github.com/biomejs/biome/issues/1724).

It's recommended to use a [Biome configuration file](/guides/how-biome-works#configuration) to ensure that both the Biome CLI and the Biome LSP apply the same options.
It's recommended to use a [Biome configuration file](/guides/configure-biome) to ensure that both the Biome CLI and the Biome LSP apply the same options.
The following defaults are applied:

```json title="biome.json"
Expand Down Expand Up @@ -90,7 +90,7 @@ The main language-agnostic options supported by the Biome formatter are:
See the [configuration reference](/reference/configuration#formatter) for more details.


## Ignoring Code
## Ignore Code

There are times when the formatted code isn't ideal.

Expand Down Expand Up @@ -125,29 +125,5 @@ const expr =
];
```


## Ignoring files

Biome doesn't provide ignore comments that ignore an entire file.
However, you can ignore a file using the Biome configuration file.

You can ignore files for all tools, including the formatter,
using the [`files.ignore` configuration](/guides/how-biome-works#include-and-ignore-explained).
By default, Biome ignores the [protected files](/guides/how-biome-works#protected-files).

If you want to exclude files from being formatted, you can use `formatter.ignore`:

```json title="biome.jsonc"
{
"files": {
// All tools, including the formatter, ignore following files
"ignore": ["dist/**"]
},
"formatter": {
// Only the formatter ignores the following files
"ignore": ["test/**"]
}
}
```

Note that you can also [ignore files ignored by your VCS](/guides/integrate-in-vcs#use-the-ignore-file).
However, you can [ignore a file using the Biome configuration file](/guides/configure-biome/#ignore-files).
2 changes: 1 addition & 1 deletion src/content/docs/guides/big-projects.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ When you run a script from `app/frontend/legacy-app/package.json` or `app/fronte

## Share the configuration

It's possible to use the [`extends`](/guides/how-biome-works/#the-extends-option) configuration option to breakdown options across files.
It's possible to use the [`extends`](/guides/configure-biome/#share-a-configuration-file) configuration option to breakdown options across files.

Let's assume that we have these requirements:
- `legacy-app` have to format using spaces;
Expand Down
Loading