From ad33af88c834b228c3f9a5025112ee145b937759 Mon Sep 17 00:00:00 2001 From: Emanuele Stoppa Date: Mon, 28 Aug 2023 15:03:02 +0100 Subject: [PATCH] chore: add schema and fix typo --- .../main_commands_check/check_help.snap | 2 +- .../snapshots/main_commands_ci/ci_help.snap | 2 +- .../main_commands_format/format_help.snap | 2 +- .../main_commands_lint/check_help.snap | 2 +- crates/rome_service/src/configuration/mod.rs | 2 +- website/src/pages/cli.mdx | 10 +++++----- website/src/pages/schemas/1.0.0/schema.json.js | 18 ++++++++++++++++++ website/src/pages/vscode.mdx | 13 ++++++++++++- 8 files changed, 40 insertions(+), 11 deletions(-) create mode 100644 website/src/pages/schemas/1.0.0/schema.json.js diff --git a/crates/rome_cli/tests/snapshots/main_commands_check/check_help.snap b/crates/rome_cli/tests/snapshots/main_commands_check/check_help.snap index b89835733522..5cf163c01f5d 100644 --- a/crates/rome_cli/tests/snapshots/main_commands_check/check_help.snap +++ b/crates/rome_cli/tests/snapshots/main_commands_check/check_help.snap @@ -20,7 +20,7 @@ The configuration that is contained inside the file `biome.json` working directory. If no current working directory can't be found, Biome won't use the VCS integration, and a diagnostic will be emitted --files-max-size=NUMBER The maximum allowed size for source code files in bytes. Files above - this limit will be ignored for performance reason. Defaults to 1 MiB + this limit will be ignored for performance reasons. Defaults to 1 MiB --files-ignore-unknown= Tells Biome to not emit diagnostics when handling files that doesn't know --indent-style= The indent style. diff --git a/crates/rome_cli/tests/snapshots/main_commands_ci/ci_help.snap b/crates/rome_cli/tests/snapshots/main_commands_ci/ci_help.snap index 1f614c125206..c7097575aa0f 100644 --- a/crates/rome_cli/tests/snapshots/main_commands_ci/ci_help.snap +++ b/crates/rome_cli/tests/snapshots/main_commands_ci/ci_help.snap @@ -21,7 +21,7 @@ The configuration that is contained inside the file `biome.json` working directory. If no current working directory can't be found, Biome won't use the VCS integration, and a diagnostic will be emitted --files-max-size=NUMBER The maximum allowed size for source code files in bytes. Files above - this limit will be ignored for performance reason. Defaults to 1 MiB + this limit will be ignored for performance reasons. Defaults to 1 MiB --files-ignore-unknown= Tells Biome to not emit diagnostics when handling files that doesn't know --indent-style= The indent style. diff --git a/crates/rome_cli/tests/snapshots/main_commands_format/format_help.snap b/crates/rome_cli/tests/snapshots/main_commands_format/format_help.snap index fb0b02e27f4f..5356672442fb 100644 --- a/crates/rome_cli/tests/snapshots/main_commands_format/format_help.snap +++ b/crates/rome_cli/tests/snapshots/main_commands_format/format_help.snap @@ -38,7 +38,7 @@ Set of properties to integrate Biome with a VCS software. The configuration of the filesystem --files-max-size=NUMBER The maximum allowed size for source code files in bytes. Files above - this limit will be ignored for performance reason. Defaults to 1 MiB + this limit will be ignored for performance reasons. Defaults to 1 MiB --files-ignore-unknown= Tells Biome to not emit diagnostics when handling files that doesn't know diff --git a/crates/rome_cli/tests/snapshots/main_commands_lint/check_help.snap b/crates/rome_cli/tests/snapshots/main_commands_lint/check_help.snap index aacb9a5f708f..1ad7a41363ba 100644 --- a/crates/rome_cli/tests/snapshots/main_commands_lint/check_help.snap +++ b/crates/rome_cli/tests/snapshots/main_commands_lint/check_help.snap @@ -20,7 +20,7 @@ The configuration that is contained inside the file `biome.json` working directory. If no current working directory can't be found, Biome won't use the VCS integration, and a diagnostic will be emitted --files-max-size=NUMBER The maximum allowed size for source code files in bytes. Files above - this limit will be ignored for performance reason. Defaults to 1 MiB + this limit will be ignored for performance reasons. Defaults to 1 MiB --files-ignore-unknown= Tells Biome to not emit diagnostics when handling files that doesn't know --indent-style= The indent style. diff --git a/crates/rome_service/src/configuration/mod.rs b/crates/rome_service/src/configuration/mod.rs index 9b0abfb7d6cb..2ebf6f7fa614 100644 --- a/crates/rome_service/src/configuration/mod.rs +++ b/crates/rome_service/src/configuration/mod.rs @@ -247,7 +247,7 @@ impl MergeWith> for Configuration { #[serde(rename_all = "camelCase", default, deny_unknown_fields)] pub struct FilesConfiguration { /// The maximum allowed size for source code files in bytes. Files above - /// this limit will be ignored for performance reason. Defaults to 1 MiB + /// this limit will be ignored for performance reasons. Defaults to 1 MiB #[bpaf(long("files-max-size"), argument("NUMBER"))] pub max_size: Option, diff --git a/website/src/pages/cli.mdx b/website/src/pages/cli.mdx index eea8bc5340a6..e2ce66b98fdf 100644 --- a/website/src/pages/cli.mdx +++ b/website/src/pages/cli.mdx @@ -56,7 +56,7 @@ Biome official CLI. Use it to check the health of your project or run it to chec - **`ci`** — Command to use in CI environments. Run various checks of a set of files. - **`init`** — - Bootstraps a new Biome project. Creates a configuration file with some defaults. + Bootstraps a new biome project. Creates a configuration file with some defaults. - **`lsp-proxy`** — Acts as a server for the Language Server Protocol over stdin/stdout - **`migrate`** — @@ -169,7 +169,7 @@ Run various checks on a set of files. If Biome can't find the configuration, it will attempt to use the current working directory. If no current working directory can't be found, Biome won't use the VCS integration, and a diagnostic will be emitted - **` --files-max-size`**=_`NUMBER`_ — - The maximum allowed size for source code files in bytes. Files above this limit will be ignored for performance reason. Defaults to 1 MiB + The maximum allowed size for source code files in bytes. Files above this limit will be ignored for performance reasons. Defaults to 1 MiB - **` --files-ignore-unknown`**=_``_ — Tells Biome to not emit diagnostics when handling files that doesn't know - **` --indent-style`**=_``_ — @@ -256,7 +256,7 @@ Run various checks on a set of files. If Biome can't find the configuration, it will attempt to use the current working directory. If no current working directory can't be found, Biome won't use the VCS integration, and a diagnostic will be emitted - **` --files-max-size`**=_`NUMBER`_ — - The maximum allowed size for source code files in bytes. Files above this limit will be ignored for performance reason. Defaults to 1 MiB + The maximum allowed size for source code files in bytes. Files above this limit will be ignored for performance reasons. Defaults to 1 MiB - **` --files-ignore-unknown`**=_``_ — Tells Biome to not emit diagnostics when handling files that doesn't know - **` --indent-style`**=_``_ — @@ -367,7 +367,7 @@ Run the formatter on a set of files. **The configuration of the filesystem** - **` --files-max-size`**=_`NUMBER`_ — - The maximum allowed size for source code files in bytes. Files above this limit will be ignored for performance reason. Defaults to 1 MiB + The maximum allowed size for source code files in bytes. Files above this limit will be ignored for performance reasons. Defaults to 1 MiB - **` --files-ignore-unknown`**=_``_ — Tells Biome to not emit diagnostics when handling files that doesn't know @@ -428,7 +428,7 @@ Command to use in CI environments. Run various checks of a set of files. If Biome can't find the configuration, it will attempt to use the current working directory. If no current working directory can't be found, Biome won't use the VCS integration, and a diagnostic will be emitted - **` --files-max-size`**=_`NUMBER`_ — - The maximum allowed size for source code files in bytes. Files above this limit will be ignored for performance reason. Defaults to 1 MiB + The maximum allowed size for source code files in bytes. Files above this limit will be ignored for performance reasons. Defaults to 1 MiB - **` --files-ignore-unknown`**=_``_ — Tells Biome to not emit diagnostics when handling files that doesn't know - **` --indent-style`**=_``_ — diff --git a/website/src/pages/schemas/1.0.0/schema.json.js b/website/src/pages/schemas/1.0.0/schema.json.js new file mode 100644 index 000000000000..78ea351942e3 --- /dev/null +++ b/website/src/pages/schemas/1.0.0/schema.json.js @@ -0,0 +1,18 @@ +// Run `BIOME_VERSION= cargo codegen-website +// to generate a new schema +import { readFileSync } from "fs"; +import { join, resolve } from "path"; + +export function get() { + const schemaPath = resolve( + join("..", "packages", "@biomejs", "biome", "configuration_schema.json"), + ); + const schema = readFileSync(schemaPath, "utf8"); + + return new Response(schema, { + status: 200, + headers: { + "content-type": "application/json", + }, + }); +} diff --git a/website/src/pages/vscode.mdx b/website/src/pages/vscode.mdx index a25d038eb552..88d4553bcb2e 100644 --- a/website/src/pages/vscode.mdx +++ b/website/src/pages/vscode.mdx @@ -72,7 +72,18 @@ Biome respects VS Code's _Format on Save_ setting. To enable format on save, ope ### Fix on save -Biome respects VS Code's _Code Actions On Save_ setting. To enable fix on save, add `"editor.codeActionsOnSave": { "quickfix.biome": true }` in vscode settings.json. +Biome respects VS Code's _Code Actions On Save_ setting. To enable fix on save, add + + +```json +{ + "editor.codeActionsOnSave": { + "quickfix.biome": true + } +} +``` + +in vscode `settings.json`. ### Imports Sorting [Experimental]