From fbf8461a61a03195e39f7ce932060b966884c694 Mon Sep 17 00:00:00 2001 From: u1aryz Date: Sat, 6 Jul 2024 15:49:21 +0900 Subject: [PATCH 1/2] Updated Japanese translation of the Language Support section in the documentation --- .../docs/ja/internals/language-support.mdx | 72 +++++++++++++++++-- 1 file changed, 66 insertions(+), 6 deletions(-) diff --git a/src/content/docs/ja/internals/language-support.mdx b/src/content/docs/ja/internals/language-support.mdx index 4fa1a584e..266c36918 100644 --- a/src/content/docs/ja/internals/language-support.mdx +++ b/src/content/docs/ja/internals/language-support.mdx @@ -3,18 +3,24 @@ title: 言語サポート description: Biomeがサポートする言語と機能。 --- +凡例: +- ✅: 対応済み +- 🚫: 進行中ではない +- ⌛️: 進行中 +- ⚠️: 一部サポート(いくつかの注意点あり) + | Language | Parsing | Formatting | Linting | | -------- | ------- | ---------- | ------- | -| [JavaScript](#javascript-support) | | | | -| [TypeScript](#typescript-support) | | | | +| [JavaScript](#javascriptのサポート) | | | | +| [TypeScript](#typescriptのサポート) | | | | | JSX | | | | | TSX | | | | | JSON | | | | | JSONC | | | | | HTML | ⌛️ | 🚫 | 🚫 | -| [Vue](#html-super-languages-support) | 🚫 | 🚫 | 🚫 | -| [Svelte](#html-super-languages-support) | 🚫 | 🚫 | 🚫 | -| [Astro](#html-super-languages-support) | 🚫 | 🚫 | 🚫 | +| [Vue](#html拡張言語のサポート) | ⚠️ | ⚠️ | ⚠️ | +| [Svelte](#html拡張言語のサポート) | ⚠️ | ⚠️ | ⚠️ | +| [Astro](#html拡張言語のサポート) | ⚠️ | ⚠️ | ⚠️ | | CSS | ✅️ | ⌛️ | ⌛️ | | [YAML](https://github.com/biomejs/biome/issues/2365) | ⌛️ | 🚫 | 🚫 | | [GraphQL](https://github.com/biomejs/biome/issues/1927) | ⌛️ | 🚫 | 🚫 | @@ -29,6 +35,60 @@ Biomeは、JavaScript(ES2023)をサポートしています。 Biomeは、TypeScriptバージョン5.2をサポートしています。 +## JSONCサポート + +JSONCは「コメント付きJSON」の略です。この形式は、[VS Code](https://code.visualstudio.com/docs/languages/json#_json-with-comments)、[TypeScript](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html)、[Babel](https://babeljs.io/docs/config-files)などのさまざまなツールで広く使用されています。JSONCは、構成ファイルにコメントを追加できるため便利です。ただし、JSONCは厳密な標準ではないため、ツールごとに末尾のカンマの扱いが異なる場合があります。これに対応するために、Biomeは専用のJSONC言語設定を提供する代わりに、JSONのパースおよびフォーマット機能を拡張し、 `json.parser.allowComments` 、 `json.parser.allowTrailingCommas` 、 `json.formatter.trailingCommas` などのオプションを提供しています。このアプローチにより、BiomeはさまざまなバリエーションのJSONファイルを効果的にサポートできます。 + +`.jsonc` 拡張子を持つファイルや[言語識別子](https://code.visualstudio.com/docs/languages/identifiers)に従って `jsonc` として識別されるファイルに対して、Biomeは自動的に次のデフォルト設定を適用してパースおよびフォーマットを行います: + +- `json.parser.allowComments`: `true` +- `json.parser.allowTrailingCommas`: `true` +- `json.formatter.trailingCommas`: `none` + +`tsconfig.json` や `.babelrc` などのよく知られたファイルは `.jsonc` 拡張子を使用しませんが、コメントや末尾のカンマを許可するものもあります。一方、 `.eslintrc.json` のようなファイルはコメントのみを許可します。Biomeはこれらのファイルを識別し、適切に `json.parser.allowTrailingCommas` オプションを調整して正しくパースできるようにします。 + +[このセクション](/ja/guides/how-biome-works#既知のファイル)では、Biomeが認識できる既知のファイルの完全なリストを提供しています。 + ## HTML拡張言語のサポート -HTML拡張言語を適切にサポートするためには、CSS、HTML、JavaScriptのパースが必要です。これらのパーサーが利用可能になったとき、サポート作業を開始できます。 +バージョン `1.6.0` 以降、これらの言語は**部分的に**サポートされています。Biomeは時間とともに改善され、プロジェクトを調整するためのオプションが増えていく予定です。しかし、現在ではいくつかの期待と制限を考慮する必要があります: +- `.astro` ファイルでは、**フロントマター部分のみ**がサポートされています。 +- `.vue` および `.svelte` ファイルでは、**\タグ部分のみ**がサポートされています。 +- 診断は上記の部分に属するコードフレームのみを表示します。 +- `.vue` および `.svelte` ファイルを**フォーマット**する際、JavaScript/TypeScriptコードのインデントは最初から始まります。 + + ```vue title="file.vue" del={2} ins={3} + + ``` + +- `.astro` ファイルを**静的解析**する際、誤検知を避けるために `javascript.globals` に `"Astro"` を追加する必要があります。 + + ```json title="biome.json" + { + "javascript": { + "globals": ["Astro"] + } + } + ``` + +- `.svelte` ファイルを**静的解析**する際、コンパイラエラーを防ぐために `useConst` をオフにすることをお勧めします。オプション `overrides` を使用します: + + ```json + { + "overrides": [ + { + "include": ["*.svelte"], + "linter": { + "rules": { + "style": { + "useConst": "off" + } + } + } + } + ] + } + ``` From f27906320d3beb7c67efc2f016f20b6843d708b5 Mon Sep 17 00:00:00 2001 From: u1aryz Date: Sat, 6 Jul 2024 16:01:41 +0900 Subject: [PATCH 2/2] Fixed textlint --- src/content/docs/ja/internals/language-support.mdx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/content/docs/ja/internals/language-support.mdx b/src/content/docs/ja/internals/language-support.mdx index 266c36918..38bbfce25 100644 --- a/src/content/docs/ja/internals/language-support.mdx +++ b/src/content/docs/ja/internals/language-support.mdx @@ -3,7 +3,7 @@ title: 言語サポート description: Biomeがサポートする言語と機能。 --- -凡例: +凡例: - ✅: 対応済み - 🚫: 進行中ではない - ⌛️: 進行中 @@ -37,9 +37,9 @@ Biomeは、TypeScriptバージョン5.2をサポートしています。 ## JSONCサポート -JSONCは「コメント付きJSON」の略です。この形式は、[VS Code](https://code.visualstudio.com/docs/languages/json#_json-with-comments)、[TypeScript](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html)、[Babel](https://babeljs.io/docs/config-files)などのさまざまなツールで広く使用されています。JSONCは、構成ファイルにコメントを追加できるため便利です。ただし、JSONCは厳密な標準ではないため、ツールごとに末尾のカンマの扱いが異なる場合があります。これに対応するために、Biomeは専用のJSONC言語設定を提供する代わりに、JSONのパースおよびフォーマット機能を拡張し、 `json.parser.allowComments` 、 `json.parser.allowTrailingCommas` 、 `json.formatter.trailingCommas` などのオプションを提供しています。このアプローチにより、BiomeはさまざまなバリエーションのJSONファイルを効果的にサポートできます。 +JSONCは「コメント付きJSON」の略です。この形式は、[VS Code](https://code.visualstudio.com/docs/languages/json#_json-with-comments)、[TypeScript](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html)、[Babel](https://babeljs.io/docs/config-files)などのさまざまなツールで広く使用されています。JSONCは、構成ファイルにコメントを追加できるため便利です。ただし、JSONCは厳密な標準ではないため、ツールごとに末尾のカンマの扱いが異なる場合があります。これに対応するために、Biomeは専用のJSONC言語設定を提供する代わりに、JSONのパースおよびformat機能を拡張し、 `json.parser.allowComments` 、 `json.parser.allowTrailingCommas` 、 `json.formatter.trailingCommas` などのオプションを提供しています。このアプローチにより、BiomeはさまざまなバリエーションのJSONファイルを効果的にサポートできます。 -`.jsonc` 拡張子を持つファイルや[言語識別子](https://code.visualstudio.com/docs/languages/identifiers)に従って `jsonc` として識別されるファイルに対して、Biomeは自動的に次のデフォルト設定を適用してパースおよびフォーマットを行います: +`.jsonc` 拡張子を持つファイルや[言語識別子](https://code.visualstudio.com/docs/languages/identifiers)に従って `jsonc` として識別されるファイルに対して、Biomeは自動的に次のデフォルト設定を適用してパースおよびformatを行います: - `json.parser.allowComments`: `true` - `json.parser.allowTrailingCommas`: `true` @@ -51,11 +51,11 @@ JSONCは「コメント付きJSON」の略です。この形式は、[VS Code](h ## HTML拡張言語のサポート -バージョン `1.6.0` 以降、これらの言語は**部分的に**サポートされています。Biomeは時間とともに改善され、プロジェクトを調整するためのオプションが増えていく予定です。しかし、現在ではいくつかの期待と制限を考慮する必要があります: +バージョン `1.6.0` 以降、これらの言語は**部分的に**サポートされています。Biomeは時間とともに改善され、プロジェクトを調整するためのオプションが増えていく予定です。しかし、現在ではいくつかの期待と制限を考慮する必要があります: - `.astro` ファイルでは、**フロントマター部分のみ**がサポートされています。 - `.vue` および `.svelte` ファイルでは、**\タグ部分のみ**がサポートされています。 - 診断は上記の部分に属するコードフレームのみを表示します。 -- `.vue` および `.svelte` ファイルを**フォーマット**する際、JavaScript/TypeScriptコードのインデントは最初から始まります。 +- `.vue` および `.svelte` ファイルを**format**する際、JavaScript/TypeScriptコードのインデントは最初から始まります。 ```vue title="file.vue" del={2} ins={3}