@biomejs/biome 1.4.1 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE-APACHE +2 -2
- package/README.ja.md +121 -0
- package/README.md +15 -6
- package/README.pt-br.md +125 -0
- package/README.zh-CN.md +117 -0
- package/bin/biome +26 -1
- package/configuration_schema.json +300 -16
- package/package.json +1 -1
- package/scripts/postinstall.js +25 -1
package/LICENSE-APACHE
CHANGED
|
@@ -186,7 +186,7 @@ APPENDIX: How to apply the Apache License to your work.
|
|
|
186
186
|
same "printed page" as the copyright notice for easier
|
|
187
187
|
identification within third-party archives.
|
|
188
188
|
|
|
189
|
-
Copyright
|
|
189
|
+
Copyright (c) 2023 Biome Developers and Contributors.
|
|
190
190
|
|
|
191
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
192
|
you may not use this file except in compliance with the License.
|
|
@@ -198,4 +198,4 @@ Unless required by applicable law or agreed to in writing, software
|
|
|
198
198
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
199
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
200
|
See the License for the specific language governing permissions and
|
|
201
|
-
limitations under the License.
|
|
201
|
+
limitations under the License.
|
package/README.ja.md
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/biomejs/resources/main/svg/slogan-dark-transparent.svg">
|
|
4
|
+
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/biomejs/resources/main/svg/slogan-light-transparent.svg">
|
|
5
|
+
<img alt="Biome - Toolchain of the web" src="https://raw.githubusercontent.com/biomejs/resources/main/svg/slogan-light-transparent.svg" width="700">
|
|
6
|
+
</picture>
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<div align="center">
|
|
10
|
+
|
|
11
|
+
[![Discord chat][discord-badge]][discord-url]
|
|
12
|
+
[![CI on main][ci-badge]][ci-url]
|
|
13
|
+
[![npm version][npm-badge]][npm-url]
|
|
14
|
+
[![VSCode version][vscode-badge]][vscode-url]
|
|
15
|
+
[![Open VSX version][open-vsx-badge]][open-vsx-url]
|
|
16
|
+
|
|
17
|
+
[discord-badge]: https://badgen.net/discord/online-members/BypW39g6Yc?icon=discord&label=discord&color=green
|
|
18
|
+
[discord-url]: https://discord.gg/BypW39g6Yc
|
|
19
|
+
[ci-badge]: https://github.com/biomejs/biome/actions/workflows/main.yml/badge.svg
|
|
20
|
+
[ci-url]: https://github.com/biomejs/biome/actions/workflows/main.yml
|
|
21
|
+
[npm-badge]: https://badgen.net/npm/v/@biomejs/biome?icon=npm&color=green&label=%40biomejs%2Fbiome
|
|
22
|
+
[npm-url]: https://www.npmjs.com/package/@biomejs/biome/v/latest
|
|
23
|
+
[vscode-badge]: https://badgen.net/vs-marketplace/v/biomejs.biome?label=vscode&icon=visualstudio&color=green
|
|
24
|
+
[vscode-url]: https://marketplace.visualstudio.com/items?itemName=biomejs.biome
|
|
25
|
+
[open-vsx-badge]: https://badgen.net/open-vsx/version/biomejs/biome?label=open-vsx&color=green
|
|
26
|
+
[open-vsx-url]: https://open-vsx.org/extension/biomejs/biome
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<div align="center">
|
|
31
|
+
|
|
32
|
+
[English](https://github.com/biomejs/biome/blob/main/packages/%40biomejs/biome/README.md) | [简体中文](https://github.com/biomejs/biome/blob/main/packages/%40biomejs/biome/README.zh-CN.md) | 日本語 | [Português do Brasil](https://github.com/biomejs/biome/blob/main/packages/%40biomejs/biome/README.pt-br.md)
|
|
33
|
+
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
**Biome** はWebプロジェクトのための高性能なツールチェーンであり、プロジェクトの健全性を維持するための開発者ツールの提供を目的としています。
|
|
37
|
+
|
|
38
|
+
**Biome は _JavaScript_, _TypeScript_, _JSX_ そして _JSON_ 向けの[高速なFormatter](./benchmark#formatting)**であり、**[_Prettier_ との互換性は97%](https://console.algora.io/challenges/prettier)** を達成しています。
|
|
39
|
+
|
|
40
|
+
**Biome は _JavaScript_, _TypeScript_, _JSX_ のための[高性能なLinter](https://github.com/biomejs/biome/tree/main/benchmark#linting)** であり、ESLint, TypeScript ESLint, [その他のソース](https://github.com/biomejs/biome/discussions/3)から **[170以上のルール](https://biomejs.dev/linter/rules/)**を提供しています。Biome は**詳細で文脈に沿った結果を出力**するため、コードを改善し、より良いプログラマになるための手助けをします!
|
|
41
|
+
|
|
42
|
+
**Biome** は最初から[**エディタ内で対話的に**](https://biomejs.dev/ja/guides/integrate-in-editor/)使用できるように設計されています。
|
|
43
|
+
あなたがコードを書いているときに、形の崩れたコードを format と lint することができます。
|
|
44
|
+
|
|
45
|
+
### インストール
|
|
46
|
+
|
|
47
|
+
```shell
|
|
48
|
+
npm install --save-dev --save-exact @biomejs/biome
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### 使い方
|
|
52
|
+
|
|
53
|
+
```shell
|
|
54
|
+
# ファイルをformatする
|
|
55
|
+
npx @biomejs/biome format --write ./src
|
|
56
|
+
|
|
57
|
+
# ファイルをlintする
|
|
58
|
+
npx @biomejs/biome lint ./src
|
|
59
|
+
|
|
60
|
+
# format、lintなどを実行し、安全な提案を適用する
|
|
61
|
+
npx @biomejs/biome check --apply ./src
|
|
62
|
+
|
|
63
|
+
# CI環境では、すべてのファイルを対象にformatやlintをチェックする
|
|
64
|
+
npx @biomejs/biome ci ./src
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Biome をインストールせずに試したい場合は、WebAssembly にコンパイルされた[オンラインのプレイグラウンド](https://biomejs.dev/playground/)を利用してください。
|
|
68
|
+
|
|
69
|
+
## ドキュメント
|
|
70
|
+
|
|
71
|
+
Biome についてもっと知るために[ホームページ][biomejs]をチェックするか、Biome を使い始めるために[はじめる][getting-started]に進んでください。
|
|
72
|
+
|
|
73
|
+
## Biome をもっと詳しく
|
|
74
|
+
|
|
75
|
+
**Biome** は理にかなったデフォルト設定を持ち、設定を必要としません。
|
|
76
|
+
|
|
77
|
+
**Biome** はモダンなウェブ開発における[全ての主要な言語][language-support]をサポートすることを目指しています。
|
|
78
|
+
|
|
79
|
+
**Biome** は動作するために Node.js を必要としません。
|
|
80
|
+
|
|
81
|
+
**Biome** はソーステキストの完全な表現力とエラー回復能力を持つ洗練されたParserによって、優れたLSPサポートを提供します。
|
|
82
|
+
|
|
83
|
+
**Biome** は以前は別々のツールで提供されていた機能を統合します。共通基盤を構築することで、コードの処理、エラーの表示、並列処理、キャッシュ、設定について統一的な体験を提供します。
|
|
84
|
+
|
|
85
|
+
興味のある方は、[プロジェクトの理念][biome-philosophy]もご覧ください。
|
|
86
|
+
|
|
87
|
+
**Biome** は [MIT ライセンス](https://github.com/biomejs/biome/tree/main/LICENSE-MIT)または [Apache 2.0 ライセンス](https://github.com/biomejs/biome/tree/main/LICENSE-APACHE)であり、[コントリビューター行動規範](https://github.com/biomejs/biome/tree/main/CODE_OF_CONDUCT.md)の下で管理されています。
|
|
88
|
+
|
|
89
|
+
## スポンサー
|
|
90
|
+
|
|
91
|
+
### ゴールドスポンサー
|
|
92
|
+
|
|
93
|
+
<table>
|
|
94
|
+
<tbody>
|
|
95
|
+
<tr>
|
|
96
|
+
<td align="center" valign="middle">
|
|
97
|
+
<a href="https://shiguredo.jp/" target="_blank"><img src="https://shiguredo.jp/official_shiguredo_logo.svg" height="120"></a>
|
|
98
|
+
</td>
|
|
99
|
+
</tr>
|
|
100
|
+
</tbody>
|
|
101
|
+
</table>
|
|
102
|
+
|
|
103
|
+
### ブロンズスポンサー
|
|
104
|
+
|
|
105
|
+
<table>
|
|
106
|
+
<tbody>
|
|
107
|
+
<tr>
|
|
108
|
+
<td align="center" valign="middle">
|
|
109
|
+
<a href="https://www.kanamekey.com" target="_blank"><img src="https://images.opencollective.com/kaname/d15fd98/logo/256.png?height=80" width="80"></a>
|
|
110
|
+
</td>
|
|
111
|
+
<td align="center" valign="middle">
|
|
112
|
+
<a href="https://nanabit.dev/" target="_blank"><img src="https://images.opencollective.com/nanabit/d15fd98/logo/256.png?height=80" width="80"></a>
|
|
113
|
+
</td>
|
|
114
|
+
</tr>
|
|
115
|
+
</tbody>
|
|
116
|
+
</table>
|
|
117
|
+
|
|
118
|
+
[biomejs]: https://biomejs.dev/ja/
|
|
119
|
+
[biome-philosophy]: https://biomejs.dev/ja/internals/philosophy/
|
|
120
|
+
[language-support]: https://biomejs.dev/ja/internals/language-support/
|
|
121
|
+
[getting-started]: https://biomejs.dev/ja/guides/getting-started/
|
package/README.md
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/biomejs/resources/main/svg/slogan-dark-transparent.svg">
|
|
4
|
+
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/biomejs/resources/main/svg/slogan-light-transparent.svg">
|
|
5
|
+
<img alt="Shows the banner of Biome, with its logo and the phrase 'Biome - Toolchain of the web'." src="https://raw.githubusercontent.com/biomejs/resources/main/svg/slogan-light-transparent.svg" width="700">
|
|
6
|
+
</picture>
|
|
5
7
|
</p>
|
|
6
8
|
|
|
7
9
|
<div align="center">
|
|
@@ -23,14 +25,19 @@
|
|
|
23
25
|
[open-vsx-badge]: https://badgen.net/open-vsx/version/biomejs/biome?label=open-vsx&color=green
|
|
24
26
|
[open-vsx-url]: https://open-vsx.org/extension/biomejs/biome
|
|
25
27
|
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<div align="center">
|
|
31
|
+
|
|
32
|
+
English | [简体中文](https://github.com/biomejs/biome/blob/main/packages/%40biomejs/biome/README.zh-CN.md) | [日本語](https://github.com/biomejs/biome/blob/main/packages/%40biomejs/biome/README.ja.md) | [Português do Brasil](https://github.com/biomejs/biome/blob/main/packages/%40biomejs/biome/README.pt-br.md)
|
|
26
33
|
|
|
27
34
|
</div>
|
|
28
35
|
|
|
29
36
|
**Biome** is a performant toolchain for web projects, it aims to provide developer tools to maintain the health of said projects.
|
|
30
37
|
|
|
31
|
-
**Biome is a [fast formatter](./benchmark#formatting)** for _JavaScript_, _TypeScript_, _JSX_, and _JSON_ that scores **[
|
|
38
|
+
**Biome is a [fast formatter](./benchmark#formatting)** for _JavaScript_, _TypeScript_, _JSX_, and _JSON_ that scores **[97% compatibility with _Prettier_](https://console.algora.io/challenges/prettier)**.
|
|
32
39
|
|
|
33
|
-
**Biome is a [performant linter](https://github.com/biomejs/biome/tree/main/benchmark#linting)** for _JavaScript_, _TypeScript_, and _JSX_ that features **[more than
|
|
40
|
+
**Biome is a [performant linter](https://github.com/biomejs/biome/tree/main/benchmark#linting)** for _JavaScript_, _TypeScript_, and _JSX_ that features **[more than 190 rules](https://biomejs.dev/linter/rules/)** from ESLint, TypeScript ESLint, and [other sources](https://github.com/biomejs/biome/discussions/3).
|
|
34
41
|
It **outputs detailed and contextualized diagnostics** that help you to improve your code and become a better programmer!
|
|
35
42
|
|
|
36
43
|
**Biome** is designed from the start to be used [interactively within an editor](https://biomejs.dev/guides/integrate-in-editor/).
|
|
@@ -103,11 +110,13 @@ Read more about our [project philosophy][biome-philosophy].
|
|
|
103
110
|
<td align="center" valign="middle">
|
|
104
111
|
<a href="https://www.kanamekey.com" target="_blank"><img src="https://images.opencollective.com/kaname/d15fd98/logo/256.png?height=80" width="80"></a>
|
|
105
112
|
</td>
|
|
113
|
+
<td align="center" valign="middle">
|
|
114
|
+
<a href="https://nanabit.dev/" target="_blank"><img src="https://images.opencollective.com/nanabit/d15fd98/logo/256.png?height=80" width="80"></a>
|
|
115
|
+
</td>
|
|
106
116
|
</tr>
|
|
107
117
|
</tbody>
|
|
108
118
|
</table>
|
|
109
119
|
|
|
110
|
-
[bench]: https://github.com/biomejs/biome/blob/main/benchmark/README.md
|
|
111
120
|
[biomejs]: https://biomejs.dev/
|
|
112
121
|
[biome-philosophy]: https://biomejs.dev/internals/philosophy/
|
|
113
122
|
[language-support]: https://biomejs.dev/internals/language-support/
|
package/README.pt-br.md
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/biomejs/resources/main/svg/slogan-dark-transparent.svg">
|
|
4
|
+
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/biomejs/resources/main/svg/slogan-light-transparent.svg">
|
|
5
|
+
<img alt="Biome - Conjunto de ferramentas da web" src="https://raw.githubusercontent.com/biomejs/resources/main/svg/slogan-light-transparent.svg" width="700">
|
|
6
|
+
</picture>
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<div align="center">
|
|
10
|
+
|
|
11
|
+
[![Chat no Discord][discord-badge]][discord-url]
|
|
12
|
+
[![CI na `main`][ci-badge]][ci-url]
|
|
13
|
+
[![versão npm][npm-badge]][npm-url]
|
|
14
|
+
[![versão VSCode][vscode-badge]][vscode-url]
|
|
15
|
+
[![versão Open VSX][open-vsx-badge]][open-vsx-url]
|
|
16
|
+
|
|
17
|
+
[discord-badge]: https://badgen.net/discord/online-members/BypW39g6Yc?icon=discord&label=discord&color=green
|
|
18
|
+
[discord-url]: https://discord.gg/BypW39g6Yc
|
|
19
|
+
[ci-badge]: https://github.com/biomejs/biome/actions/workflows/main.yml/badge.svg
|
|
20
|
+
[ci-url]: https://github.com/biomejs/biome/actions/workflows/main.yml
|
|
21
|
+
[npm-badge]: https://badgen.net/npm/v/@biomejs/biome?icon=npm&color=green&label=%40biomejs%2Fbiome
|
|
22
|
+
[npm-url]: https://www.npmjs.com/package/@biomejs/biome/v/latest
|
|
23
|
+
[vscode-badge]: https://badgen.net/vs-marketplace/v/biomejs.biome?label=vscode&icon=visualstudio&color=green
|
|
24
|
+
[vscode-url]: https://marketplace.visualstudio.com/items?itemName=biomejs.biome
|
|
25
|
+
[open-vsx-badge]: https://badgen.net/open-vsx/version/biomejs/biome?label=open-vsx&color=green
|
|
26
|
+
[open-vsx-url]: https://open-vsx.org/extension/biomejs/biome
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<div align="center">
|
|
31
|
+
|
|
32
|
+
[English](https://github.com/biomejs/biome/blob/main/packages/%40biomejs/biome/README.md) | [简体中文](https://github.com/biomejs/biome/blob/main/packages/%40biomejs/biome/README.zh-CN.md) | [日本語](https://github.com/biomejs/biome/blob/main/packages/%40biomejs/biome/README.ja.md) | Português do Brasil
|
|
33
|
+
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
**Biome** é um conjunto de ferramentas de alto desempenho para projetos web, visando fornecer recursos de desenvolvimento para manter a saúde desses projetos.
|
|
37
|
+
|
|
38
|
+
**Biome é um [formatador rápido](./benchmark#formatting)** para _JavaScript_, _TypeScript_, _JSX_, e _JSON_ que atinge **[97% de compatibilidade com o _Prettier_](https://console.algora.io/challenges/prettier)**.
|
|
39
|
+
|
|
40
|
+
**Biome é um [linter eficiente](https://github.com/biomejs/biome/tree/main/benchmark#linting)** para _JavaScript_, _TypeScript_, e _JSX_ que possui **[mais de 190 regras](https://biomejs.dev/linter/rules/)** do ESLint, TypeScript ESLint, e de [outras fontes](https://github.com/biomejs/biome/discussions/3).
|
|
41
|
+
Ele **fornece diagnósticos detalhados e contextualizados** que ajudam você a melhorar seu código e se tornar um programador melhor!
|
|
42
|
+
|
|
43
|
+
**Biome** é projetado desde o início para ser usado [interativamente dentro de um editor](https://biomejs.dev/guides/integrate-in-editor/).
|
|
44
|
+
Isso permite formatar e lintar códigos malformados enquanto você programa.
|
|
45
|
+
|
|
46
|
+
### Instalação
|
|
47
|
+
|
|
48
|
+
```shell
|
|
49
|
+
npm install --save-dev --save-exact @biomejs/biome
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Uso
|
|
53
|
+
|
|
54
|
+
```shell
|
|
55
|
+
# formatar arquivos
|
|
56
|
+
npx @biomejs/biome format --write ./src
|
|
57
|
+
|
|
58
|
+
# lintar arquivos
|
|
59
|
+
npx @biomejs/biome lint ./src
|
|
60
|
+
|
|
61
|
+
# executar formatação, lint, etc. e aplicar as sugestões seguras
|
|
62
|
+
npx @biomejs/biome check --apply ./src
|
|
63
|
+
|
|
64
|
+
# verificar todos os arquivos contra formatação, lint, etc. em ambientes CI
|
|
65
|
+
npx @biomejs/biome ci ./src
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Se você quiser experimentar o Biome sem instalá-lo, use o [playground online](https://biomejs.dev/playground/), compilado para WebAssembly.
|
|
69
|
+
|
|
70
|
+
## Documentação
|
|
71
|
+
|
|
72
|
+
Confira nossa [página inicial][biomejs] para saber mais sobre o Biome,
|
|
73
|
+
ou vá ao [Guia de Introdução][getting-started] para começar a usar o Biome.
|
|
74
|
+
|
|
75
|
+
## Mais sobre o Biome
|
|
76
|
+
|
|
77
|
+
**Biome** tem padrões robustos e não requer configuração.
|
|
78
|
+
|
|
79
|
+
**Biome** visa suportar [todas as principais linguagens][language-support] do desenvolvimento web moderno.
|
|
80
|
+
|
|
81
|
+
**Biome** [não requer Node.js](https://biomejs.dev/guides/manual-installation/) para funcionar.
|
|
82
|
+
|
|
83
|
+
**Biome** tem suporte de primeira linha para LSP, com um
|
|
84
|
+
|
|
85
|
+
parser sofisticado que representa o texto-fonte em sua total fidelidade e recuperação de erro de ponta.
|
|
86
|
+
|
|
87
|
+
**Biome** unifica funcionalidades que anteriormente eram ferramentas separadas. Construindo sobre uma base compartilhada, podemos fornecer uma experiência coesa para processar código, exibir erros, paralelizar trabalho, cache e configuração.
|
|
88
|
+
|
|
89
|
+
Leia mais sobre nossa [filosofia de projeto][biome-philosophy].
|
|
90
|
+
|
|
91
|
+
**Biome** é licenciado sob [MIT](https://github.com/biomejs/biome/tree/main/LICENSE-MIT) ou [Apache 2.0](https://github.com/biomejs/biome/tree/main/LICENSE-APACHE) e moderado sob o [Código de Conduta do Contribuidor](https://github.com/biomejs/biome/tree/main/CODE_OF_CONDUCT.md).
|
|
92
|
+
|
|
93
|
+
## Patrocinadores
|
|
94
|
+
|
|
95
|
+
### Patrocinadores Ouro
|
|
96
|
+
|
|
97
|
+
<table>
|
|
98
|
+
<tbody>
|
|
99
|
+
<tr>
|
|
100
|
+
<td align="center" valign="middle">
|
|
101
|
+
<a href="https://shiguredo.jp/" target="_blank"><img src="https://shiguredo.jp/official_shiguredo_logo.svg" height="120"></a>
|
|
102
|
+
</td>
|
|
103
|
+
</tr>
|
|
104
|
+
</tbody>
|
|
105
|
+
</table>
|
|
106
|
+
|
|
107
|
+
### Patrocinadores Bronze
|
|
108
|
+
|
|
109
|
+
<table>
|
|
110
|
+
<tbody>
|
|
111
|
+
<tr>
|
|
112
|
+
<td align="center" valign="middle">
|
|
113
|
+
<a href="https://www.kanamekey.com" target="_blank"><img src="https://images.opencollective.com/kaname/d15fd98/logo/256.png?height=80" width="80"></a>
|
|
114
|
+
</td>
|
|
115
|
+
<td align="center" valign="middle">
|
|
116
|
+
<a href="https://nanabit.dev/" target="_blank"><img src="https://images.opencollective.com/nanabit/d15fd98/logo/256.png?height=80" width="80"></a>
|
|
117
|
+
</td>
|
|
118
|
+
</tr>
|
|
119
|
+
</tbody>
|
|
120
|
+
</table>
|
|
121
|
+
|
|
122
|
+
[biomejs]: https://biomejs.dev/pt-br/
|
|
123
|
+
[biome-philosophy]: https://biomejs.dev/pt-br/internals/philosophy/
|
|
124
|
+
[language-support]: https://biomejs.dev/pt-br/internals/language-support/
|
|
125
|
+
[getting-started]: https://biomejs.dev/pt-br/guides/getting-started/
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/biomejs/resources/main/svg/slogan-dark-transparent.svg">
|
|
4
|
+
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/biomejs/resources/main/svg/slogan-light-transparent.svg">
|
|
5
|
+
<img alt="Biome - Toolchain of the web" src="https://raw.githubusercontent.com/biomejs/resources/main/svg/slogan-light-transparent.svg" width="700">
|
|
6
|
+
</picture>
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<div align="center">
|
|
10
|
+
|
|
11
|
+
[![Discord chat][discord-badge]][discord-url]
|
|
12
|
+
[![CI on main][ci-badge]][ci-url]
|
|
13
|
+
[![npm version][npm-badge]][npm-url]
|
|
14
|
+
[![VSCode version][vscode-badge]][vscode-url]
|
|
15
|
+
[![Open VSX version][open-vsx-badge]][open-vsx-url]
|
|
16
|
+
|
|
17
|
+
[discord-badge]: https://badgen.net/discord/online-members/BypW39g6Yc?icon=discord&label=discord&color=green
|
|
18
|
+
[discord-url]: https://discord.gg/BypW39g6Yc
|
|
19
|
+
[ci-badge]: https://github.com/biomejs/biome/actions/workflows/main.yml/badge.svg
|
|
20
|
+
[ci-url]: https://github.com/biomejs/biome/actions/workflows/main.yml
|
|
21
|
+
[npm-badge]: https://badgen.net/npm/v/@biomejs/biome?icon=npm&color=green&label=%40biomejs%2Fbiome
|
|
22
|
+
[npm-url]: https://www.npmjs.com/package/@biomejs/biome/v/latest
|
|
23
|
+
[vscode-badge]: https://badgen.net/vs-marketplace/v/biomejs.biome?label=vscode&icon=visualstudio&color=green
|
|
24
|
+
[vscode-url]: https://marketplace.visualstudio.com/items?itemName=biomejs.biome
|
|
25
|
+
[open-vsx-badge]: https://badgen.net/open-vsx/version/biomejs/biome?label=open-vsx&color=green
|
|
26
|
+
[open-vsx-url]: https://open-vsx.org/extension/biomejs/biome
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<div align="center">
|
|
31
|
+
|
|
32
|
+
[English](https://github.com/biomejs/biome/blob/main/packages/%40biomejs/biome/README.md) | 简体中文 | [日本語](https://github.com/biomejs/biome/blob/main/packages/%40biomejs/biome/README.ja.md) | [Português do Brasil](https://github.com/biomejs/biome/blob/main/packages/%40biomejs/biome/README.pt-br.md)
|
|
33
|
+
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
**Biome** 是一个用于 Web 项目的高性能工具链,旨在为开发者提供维护项目的工具。
|
|
37
|
+
|
|
38
|
+
**Biome 是一个[快速的格式化工具](./benchmark#formatting)**,适用于 _JavaScript_、_TypeScript_、_JSX_、_JSON_ 等,与 _Prettier_ 的兼容性达到了 **[97%](https://console.algora.io/challenges/prettier)**。
|
|
39
|
+
|
|
40
|
+
**Biome 是一个[高性能的 Linter](https://github.com/biomejs/biome/tree/main/benchmark#linting)**,适用于 _JavaScript_、_TypeScript_、_JSX_ 等,包含了来自 ESLint、TypeScript ESLint 和[其他来源](https://github.com/biomejs/biome/discussions/3)的 **[190 余项规则](https://biomejs.dev/zh-cn/linter/rules/)**。它**输出详细且有上下文诊断信息**,能帮助你优化代码,成为一名更好的程序员!
|
|
41
|
+
|
|
42
|
+
**Biome** 从一开始就设计为[在编辑器中交互式使用](https://biomejs.dev/zh-cn/guides/integrate-in-editor/)。它可以在你编写代码时格式化并检查出不规范的代码。
|
|
43
|
+
|
|
44
|
+
### 安装
|
|
45
|
+
|
|
46
|
+
```shell
|
|
47
|
+
npm install --save-dev --save-exact @biomejs/biome
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### 使用
|
|
51
|
+
|
|
52
|
+
```shell
|
|
53
|
+
# 格式化文件
|
|
54
|
+
npx @biomejs/biome format --write ./src
|
|
55
|
+
|
|
56
|
+
# Lint 文件
|
|
57
|
+
npx @biomejs/biome lint ./src
|
|
58
|
+
|
|
59
|
+
# 运行格式化,Lint 等,并应用安全的建议
|
|
60
|
+
npx @biomejs/biome check --apply ./src
|
|
61
|
+
|
|
62
|
+
# 在 CI 环境中检查所有文件是否符合格式,Lint 等
|
|
63
|
+
npx @biomejs/biome ci ./src
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
如果你想在不安装的情况下试用 Biome,可以使用[在线 playground](https://biomejs.dev/playground/),它被编译为 WebAssembly。
|
|
67
|
+
|
|
68
|
+
## 文档
|
|
69
|
+
|
|
70
|
+
查看我们的[主页][biomejs]以了解更多关于 Biome 的信息,或者直接前往[入门指南][getting-started]开始使用 Biome。
|
|
71
|
+
|
|
72
|
+
## 更多信息
|
|
73
|
+
|
|
74
|
+
**Biome** 有合理的默认设置,不需要配置。
|
|
75
|
+
|
|
76
|
+
**Biome** 旨在支持[所有主要的现代网络开发语言][language-support]。
|
|
77
|
+
|
|
78
|
+
**Biome** [不需要 Node.js](https://biomejs.dev/zh-cn/guides/manual-installation/) 就可以运行。
|
|
79
|
+
|
|
80
|
+
**Biome** 有一流的 LSP 支持,具有精密的解析器,可以完全保真地表示源文本,并具有顶级的错误恢复能力。
|
|
81
|
+
|
|
82
|
+
**Biome** 统一了以前分散的功能。基于共享的基础,我们可以提供一个处理代码、显示错误、并行工作、缓存和配置的一致体验。
|
|
83
|
+
|
|
84
|
+
阅读更多关于我们的[项目理念][biome-philosophy]。
|
|
85
|
+
|
|
86
|
+
**Biome** 采用 [MIT 许可](https://github.com/biomejs/biome/tree/main/LICENSE-MIT) 或 [Apache 2.0 许可](https://github.com/biomejs/biome/tree/main/LICENSE-APACHE),并在 [贡献者公约行为准则](https://github.com/biomejs/biome/tree/main/CODE_OF_CONDUCT.md) 下进行管理。
|
|
87
|
+
|
|
88
|
+
## 赞助商
|
|
89
|
+
|
|
90
|
+
### 金牌赞助商
|
|
91
|
+
|
|
92
|
+
<table>
|
|
93
|
+
<tbody>
|
|
94
|
+
<tr>
|
|
95
|
+
<td align="center" valign="middle">
|
|
96
|
+
<a href="https://shiguredo.jp/" target="_blank"><img src="https://shiguredo.jp/official_shiguredo_logo.svg" height="120"></a>
|
|
97
|
+
</td>
|
|
98
|
+
</tr>
|
|
99
|
+
</tbody>
|
|
100
|
+
</table>
|
|
101
|
+
|
|
102
|
+
### 铜牌赞助商
|
|
103
|
+
|
|
104
|
+
<table>
|
|
105
|
+
<tbody>
|
|
106
|
+
<tr>
|
|
107
|
+
<td align="center" valign="middle">
|
|
108
|
+
<a href="https://www.kanamekey.com" target="_blank"><img src="https://images.opencollective.com/kaname/d15fd98/logo/256.png?height=80" width="80"></a>
|
|
109
|
+
</td>
|
|
110
|
+
</tr>
|
|
111
|
+
</tbody>
|
|
112
|
+
</table>
|
|
113
|
+
|
|
114
|
+
[biomejs]: https://biomejs.dev/zh-cn/
|
|
115
|
+
[biome-philosophy]: https://biomejs.dev/zh-cn/internals/philosophy/
|
|
116
|
+
[language-support]: https://biomejs.dev/zh-cn/internals/language-support/
|
|
117
|
+
[getting-started]: https://biomejs.dev/zh-cn/guides/getting-started/
|
package/bin/biome
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
const { platform, arch, env, version, release } = process;
|
|
3
|
+
const { execSync } = require("child_process");
|
|
4
|
+
|
|
5
|
+
function isMusl() {
|
|
6
|
+
let stderr;
|
|
7
|
+
try {
|
|
8
|
+
stderr = execSync("ldd --version", {
|
|
9
|
+
stdio: ['pipe', 'pipe', 'pipe']
|
|
10
|
+
});
|
|
11
|
+
} catch (err) {
|
|
12
|
+
stderr = err.stderr;
|
|
13
|
+
}
|
|
14
|
+
if (stderr.indexOf("musl") > -1) {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
3
19
|
|
|
4
20
|
const PLATFORMS = {
|
|
5
21
|
win32: {
|
|
@@ -14,12 +30,21 @@ const PLATFORMS = {
|
|
|
14
30
|
x64: "@biomejs/cli-linux-x64/biome",
|
|
15
31
|
arm64: "@biomejs/cli-linux-arm64/biome",
|
|
16
32
|
},
|
|
33
|
+
"linux-musl": {
|
|
34
|
+
x64: "@biomejs/cli-linux-x64-musl/biome",
|
|
35
|
+
arm64: "@biomejs/cli-linux-arm64-musl/biome",
|
|
36
|
+
},
|
|
17
37
|
};
|
|
18
38
|
if (env.ROME_BINARY) {
|
|
19
39
|
console.warn(`[WARN] The environment variable "ROME_BINARY" is deprecated. Use "BIOME_BINARY" instead.`)
|
|
20
40
|
}
|
|
21
41
|
|
|
22
|
-
const binPath = env.BIOME_BINARY || env.ROME_BINARY ||
|
|
42
|
+
const binPath = env.BIOME_BINARY || env.ROME_BINARY ||
|
|
43
|
+
(platform === "linux" && isMusl()
|
|
44
|
+
? PLATFORMS?.["linux-musl"]?.[arch]
|
|
45
|
+
: PLATFORMS?.[platform]?.[arch]
|
|
46
|
+
);
|
|
47
|
+
|
|
23
48
|
if (binPath) {
|
|
24
49
|
const packageManager = detectPackageManager();
|
|
25
50
|
const result = require("child_process").spawnSync(
|
|
@@ -8,6 +8,13 @@
|
|
|
8
8
|
"description": "A field for the [JSON schema](https://json-schema.org/) specification",
|
|
9
9
|
"type": ["string", "null"]
|
|
10
10
|
},
|
|
11
|
+
"css": {
|
|
12
|
+
"description": "Specific configuration for the Css language",
|
|
13
|
+
"anyOf": [
|
|
14
|
+
{ "$ref": "#/definitions/CssConfiguration" },
|
|
15
|
+
{ "type": "null" }
|
|
16
|
+
]
|
|
17
|
+
},
|
|
11
18
|
"extends": {
|
|
12
19
|
"description": "A list of paths to other JSON files, used to extends the current configuration.",
|
|
13
20
|
"anyOf": [{ "$ref": "#/definitions/StringSet" }, { "type": "null" }]
|
|
@@ -80,6 +87,13 @@
|
|
|
80
87
|
{ "type": "null" }
|
|
81
88
|
]
|
|
82
89
|
},
|
|
90
|
+
"noAriaHiddenOnFocusable": {
|
|
91
|
+
"description": "Enforce that aria-hidden=\"true\" is not set on focusable elements.",
|
|
92
|
+
"anyOf": [
|
|
93
|
+
{ "$ref": "#/definitions/RuleConfiguration" },
|
|
94
|
+
{ "type": "null" }
|
|
95
|
+
]
|
|
96
|
+
},
|
|
83
97
|
"noAriaUnsupportedElements": {
|
|
84
98
|
"description": "Enforce that elements that do not support ARIA roles, states, and properties do not have those attributes.",
|
|
85
99
|
"anyOf": [
|
|
@@ -259,6 +273,13 @@
|
|
|
259
273
|
{ "type": "null" }
|
|
260
274
|
]
|
|
261
275
|
},
|
|
276
|
+
"useValidAriaRole": {
|
|
277
|
+
"description": "Elements with ARIA roles must use a valid, non-abstract ARIA role.",
|
|
278
|
+
"anyOf": [
|
|
279
|
+
{ "$ref": "#/definitions/RuleConfiguration" },
|
|
280
|
+
{ "type": "null" }
|
|
281
|
+
]
|
|
282
|
+
},
|
|
262
283
|
"useValidAriaValues": {
|
|
263
284
|
"description": "Enforce that ARIA state and property values are valid.",
|
|
264
285
|
"anyOf": [
|
|
@@ -442,6 +463,13 @@
|
|
|
442
463
|
{ "type": "null" }
|
|
443
464
|
]
|
|
444
465
|
},
|
|
466
|
+
"useRegexLiterals": {
|
|
467
|
+
"description": "Enforce the use of the regular expression literals instead of the RegExp constructor if possible.",
|
|
468
|
+
"anyOf": [
|
|
469
|
+
{ "$ref": "#/definitions/RuleConfiguration" },
|
|
470
|
+
{ "type": "null" }
|
|
471
|
+
]
|
|
472
|
+
},
|
|
445
473
|
"useSimpleNumberKeys": {
|
|
446
474
|
"description": "Disallow number literal object member names which are not base10 or uses underscore as separator",
|
|
447
475
|
"anyOf": [
|
|
@@ -472,6 +500,28 @@
|
|
|
472
500
|
},
|
|
473
501
|
"additionalProperties": false
|
|
474
502
|
},
|
|
503
|
+
"ConsistentArrayType": {
|
|
504
|
+
"oneOf": [
|
|
505
|
+
{
|
|
506
|
+
"description": "`ItemType[]`",
|
|
507
|
+
"type": "string",
|
|
508
|
+
"enum": ["shorthand"]
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
"description": "`Array<ItemType>`",
|
|
512
|
+
"type": "string",
|
|
513
|
+
"enum": ["generic"]
|
|
514
|
+
}
|
|
515
|
+
]
|
|
516
|
+
},
|
|
517
|
+
"ConsistentArrayTypeOptions": {
|
|
518
|
+
"type": "object",
|
|
519
|
+
"required": ["syntax"],
|
|
520
|
+
"properties": {
|
|
521
|
+
"syntax": { "$ref": "#/definitions/ConsistentArrayType" }
|
|
522
|
+
},
|
|
523
|
+
"additionalProperties": false
|
|
524
|
+
},
|
|
475
525
|
"Correctness": {
|
|
476
526
|
"description": "A list of rules that belong to this group",
|
|
477
527
|
"type": "object",
|
|
@@ -717,6 +767,80 @@
|
|
|
717
767
|
}
|
|
718
768
|
}
|
|
719
769
|
},
|
|
770
|
+
"CssConfiguration": {
|
|
771
|
+
"description": "Options applied to CSS files",
|
|
772
|
+
"type": "object",
|
|
773
|
+
"properties": {
|
|
774
|
+
"formatter": {
|
|
775
|
+
"description": "Formatting options",
|
|
776
|
+
"anyOf": [
|
|
777
|
+
{ "$ref": "#/definitions/CssFormatter" },
|
|
778
|
+
{ "type": "null" }
|
|
779
|
+
]
|
|
780
|
+
},
|
|
781
|
+
"parser": {
|
|
782
|
+
"description": "Parsing options",
|
|
783
|
+
"anyOf": [{ "$ref": "#/definitions/CssParser" }, { "type": "null" }]
|
|
784
|
+
}
|
|
785
|
+
},
|
|
786
|
+
"additionalProperties": false
|
|
787
|
+
},
|
|
788
|
+
"CssFormatter": {
|
|
789
|
+
"type": "object",
|
|
790
|
+
"properties": {
|
|
791
|
+
"enabled": {
|
|
792
|
+
"description": "Control the formatter for CSS (and its super languages) files.",
|
|
793
|
+
"type": ["boolean", "null"]
|
|
794
|
+
},
|
|
795
|
+
"indentSize": {
|
|
796
|
+
"description": "The size of the indentation applied to CSS (and its super languages) files. Default to 2.",
|
|
797
|
+
"type": ["integer", "null"],
|
|
798
|
+
"format": "uint8",
|
|
799
|
+
"minimum": 0.0
|
|
800
|
+
},
|
|
801
|
+
"indentStyle": {
|
|
802
|
+
"description": "The indent style applied to CSS (and its super languages) files.",
|
|
803
|
+
"anyOf": [
|
|
804
|
+
{ "$ref": "#/definitions/PlainIndentStyle" },
|
|
805
|
+
{ "type": "null" }
|
|
806
|
+
]
|
|
807
|
+
},
|
|
808
|
+
"indentWidth": {
|
|
809
|
+
"description": "The size of the indentation applied to CSS (and its super languages) files. Default to 2.",
|
|
810
|
+
"type": ["integer", "null"],
|
|
811
|
+
"format": "uint8",
|
|
812
|
+
"minimum": 0.0
|
|
813
|
+
},
|
|
814
|
+
"lineEnding": {
|
|
815
|
+
"description": "The type of line ending applied to CSS (and its super languages) files.",
|
|
816
|
+
"anyOf": [{ "$ref": "#/definitions/LineEnding" }, { "type": "null" }]
|
|
817
|
+
},
|
|
818
|
+
"lineWidth": {
|
|
819
|
+
"description": "What's the max width of a line applied to CSS (and its super languages) files. Defaults to 80.",
|
|
820
|
+
"anyOf": [{ "$ref": "#/definitions/LineWidth" }, { "type": "null" }]
|
|
821
|
+
},
|
|
822
|
+
"quoteStyle": {
|
|
823
|
+
"anyOf": [{ "$ref": "#/definitions/QuoteStyle" }, { "type": "null" }]
|
|
824
|
+
}
|
|
825
|
+
},
|
|
826
|
+
"additionalProperties": false
|
|
827
|
+
},
|
|
828
|
+
"CssParser": {
|
|
829
|
+
"description": "Options that changes how the CSS parser behaves",
|
|
830
|
+
"type": "object",
|
|
831
|
+
"properties": {
|
|
832
|
+
"allowWrongLineComments": {
|
|
833
|
+
"description": "Allow comments to appear on incorrect lines in `.css` files",
|
|
834
|
+
"type": ["boolean", "null"]
|
|
835
|
+
}
|
|
836
|
+
},
|
|
837
|
+
"additionalProperties": false
|
|
838
|
+
},
|
|
839
|
+
"DeprecatedHooksOptions": {
|
|
840
|
+
"description": "Options for the `useHookAtTopLevel` rule have been deprecated, since we now use the React hook naming convention to determine whether a function is a hook.",
|
|
841
|
+
"type": "object",
|
|
842
|
+
"additionalProperties": false
|
|
843
|
+
},
|
|
720
844
|
"EnumMemberCase": {
|
|
721
845
|
"description": "Supported cases for TypeScript `enum` member names.",
|
|
722
846
|
"oneOf": [
|
|
@@ -733,6 +857,52 @@
|
|
|
733
857
|
{ "description": "camelCase", "type": "string", "enum": ["camelCase"] }
|
|
734
858
|
]
|
|
735
859
|
},
|
|
860
|
+
"FilenameCase": {
|
|
861
|
+
"description": "Supported cases for TypeScript `enum` member names.",
|
|
862
|
+
"oneOf": [
|
|
863
|
+
{ "description": "camelCase", "type": "string", "enum": ["camelCase"] },
|
|
864
|
+
{
|
|
865
|
+
"description": "Match an export name",
|
|
866
|
+
"type": "string",
|
|
867
|
+
"enum": ["export"]
|
|
868
|
+
},
|
|
869
|
+
{
|
|
870
|
+
"description": "kebab-case",
|
|
871
|
+
"type": "string",
|
|
872
|
+
"enum": ["kebab-case"]
|
|
873
|
+
},
|
|
874
|
+
{
|
|
875
|
+
"description": "PascalCase",
|
|
876
|
+
"type": "string",
|
|
877
|
+
"enum": ["PascalCase"]
|
|
878
|
+
},
|
|
879
|
+
{
|
|
880
|
+
"description": "snake_case",
|
|
881
|
+
"type": "string",
|
|
882
|
+
"enum": ["snake_case"]
|
|
883
|
+
}
|
|
884
|
+
]
|
|
885
|
+
},
|
|
886
|
+
"FilenameCases": {
|
|
887
|
+
"type": "array",
|
|
888
|
+
"items": { "$ref": "#/definitions/FilenameCase" },
|
|
889
|
+
"uniqueItems": true
|
|
890
|
+
},
|
|
891
|
+
"FilenamingConventionOptions": {
|
|
892
|
+
"description": "Rule's options.",
|
|
893
|
+
"type": "object",
|
|
894
|
+
"properties": {
|
|
895
|
+
"filenameCases": {
|
|
896
|
+
"description": "Allowed cases for _TypeScript_ `enum` member names.",
|
|
897
|
+
"allOf": [{ "$ref": "#/definitions/FilenameCases" }]
|
|
898
|
+
},
|
|
899
|
+
"strictCase": {
|
|
900
|
+
"description": "If `false`, then consecutive uppercase are allowed in _camel_ and _pascal_ cases. This does not affect other [Case].",
|
|
901
|
+
"type": "boolean"
|
|
902
|
+
}
|
|
903
|
+
},
|
|
904
|
+
"additionalProperties": false
|
|
905
|
+
},
|
|
736
906
|
"FilesConfiguration": {
|
|
737
907
|
"description": "The configuration of the filesystem",
|
|
738
908
|
"type": "object",
|
|
@@ -833,7 +1003,7 @@
|
|
|
833
1003
|
"additionalProperties": false
|
|
834
1004
|
},
|
|
835
1005
|
"HooksOptions": {
|
|
836
|
-
"description": "Options for the rule `useExhaustiveDependencies`
|
|
1006
|
+
"description": "Options for the rule `useExhaustiveDependencies`",
|
|
837
1007
|
"type": "object",
|
|
838
1008
|
"required": ["hooks"],
|
|
839
1009
|
"properties": {
|
|
@@ -1112,36 +1282,64 @@
|
|
|
1112
1282
|
"description": "It enables ALL rules for this group.",
|
|
1113
1283
|
"type": ["boolean", "null"]
|
|
1114
1284
|
},
|
|
1115
|
-
"
|
|
1116
|
-
"description": "
|
|
1285
|
+
"noDuplicateJsonKeys": {
|
|
1286
|
+
"description": "Disallow two keys with the same name inside a JSON object.",
|
|
1117
1287
|
"anyOf": [
|
|
1118
1288
|
{ "$ref": "#/definitions/RuleConfiguration" },
|
|
1119
1289
|
{ "type": "null" }
|
|
1120
1290
|
]
|
|
1121
1291
|
},
|
|
1122
|
-
"
|
|
1123
|
-
"description": "Disallow
|
|
1292
|
+
"noEmptyBlockStatements": {
|
|
1293
|
+
"description": "Disallow empty block statements and static blocks.",
|
|
1124
1294
|
"anyOf": [
|
|
1125
1295
|
{ "$ref": "#/definitions/RuleConfiguration" },
|
|
1126
1296
|
{ "type": "null" }
|
|
1127
1297
|
]
|
|
1128
1298
|
},
|
|
1129
|
-
"
|
|
1130
|
-
"description": "Disallow
|
|
1299
|
+
"noEmptyTypeParameters": {
|
|
1300
|
+
"description": "Disallow empty type parameters in type aliases and interfaces.",
|
|
1131
1301
|
"anyOf": [
|
|
1132
1302
|
{ "$ref": "#/definitions/RuleConfiguration" },
|
|
1133
1303
|
{ "type": "null" }
|
|
1134
1304
|
]
|
|
1135
1305
|
},
|
|
1136
|
-
"
|
|
1137
|
-
"description": "Disallow
|
|
1306
|
+
"noGlobalAssign": {
|
|
1307
|
+
"description": "Disallow assignments to native objects and read-only global variables.",
|
|
1138
1308
|
"anyOf": [
|
|
1139
1309
|
{ "$ref": "#/definitions/RuleConfiguration" },
|
|
1140
1310
|
{ "type": "null" }
|
|
1141
1311
|
]
|
|
1142
1312
|
},
|
|
1143
|
-
"
|
|
1144
|
-
"description": "Disallow use of
|
|
1313
|
+
"noGlobalEval": {
|
|
1314
|
+
"description": "Disallow the use of global eval().",
|
|
1315
|
+
"anyOf": [
|
|
1316
|
+
{ "$ref": "#/definitions/RuleConfiguration" },
|
|
1317
|
+
{ "type": "null" }
|
|
1318
|
+
]
|
|
1319
|
+
},
|
|
1320
|
+
"noInvalidUseBeforeDeclaration": {
|
|
1321
|
+
"description": "Disallow the use of variables and function parameters before their declaration",
|
|
1322
|
+
"anyOf": [
|
|
1323
|
+
{ "$ref": "#/definitions/RuleConfiguration" },
|
|
1324
|
+
{ "type": "null" }
|
|
1325
|
+
]
|
|
1326
|
+
},
|
|
1327
|
+
"noMisleadingCharacterClass": {
|
|
1328
|
+
"description": "Disallow characters made with multiple code points in character class syntax.",
|
|
1329
|
+
"anyOf": [
|
|
1330
|
+
{ "$ref": "#/definitions/RuleConfiguration" },
|
|
1331
|
+
{ "type": "null" }
|
|
1332
|
+
]
|
|
1333
|
+
},
|
|
1334
|
+
"noNodejsModules": {
|
|
1335
|
+
"description": "Forbid the use of Node.js builtin modules.",
|
|
1336
|
+
"anyOf": [
|
|
1337
|
+
{ "$ref": "#/definitions/RuleConfiguration" },
|
|
1338
|
+
{ "type": "null" }
|
|
1339
|
+
]
|
|
1340
|
+
},
|
|
1341
|
+
"noThenProperty": {
|
|
1342
|
+
"description": "Disallow then property.",
|
|
1145
1343
|
"anyOf": [
|
|
1146
1344
|
{ "$ref": "#/definitions/RuleConfiguration" },
|
|
1147
1345
|
{ "type": "null" }
|
|
@@ -1168,6 +1366,13 @@
|
|
|
1168
1366
|
{ "type": "null" }
|
|
1169
1367
|
]
|
|
1170
1368
|
},
|
|
1369
|
+
"noUselessTernary": {
|
|
1370
|
+
"description": "Disallow ternary operators when simpler alternatives exist.",
|
|
1371
|
+
"anyOf": [
|
|
1372
|
+
{ "$ref": "#/definitions/RuleConfiguration" },
|
|
1373
|
+
{ "type": "null" }
|
|
1374
|
+
]
|
|
1375
|
+
},
|
|
1171
1376
|
"recommended": {
|
|
1172
1377
|
"description": "It enables the recommended rules for this group",
|
|
1173
1378
|
"type": ["boolean", "null"]
|
|
@@ -1179,6 +1384,34 @@
|
|
|
1179
1384
|
{ "type": "null" }
|
|
1180
1385
|
]
|
|
1181
1386
|
},
|
|
1387
|
+
"useConsistentArrayType": {
|
|
1388
|
+
"description": "Require consistently using either T[] or Array<T>",
|
|
1389
|
+
"anyOf": [
|
|
1390
|
+
{ "$ref": "#/definitions/RuleConfiguration" },
|
|
1391
|
+
{ "type": "null" }
|
|
1392
|
+
]
|
|
1393
|
+
},
|
|
1394
|
+
"useExportType": {
|
|
1395
|
+
"description": "Promotes the use of export type for types.",
|
|
1396
|
+
"anyOf": [
|
|
1397
|
+
{ "$ref": "#/definitions/RuleConfiguration" },
|
|
1398
|
+
{ "type": "null" }
|
|
1399
|
+
]
|
|
1400
|
+
},
|
|
1401
|
+
"useFilenamingConvention": {
|
|
1402
|
+
"description": "Enforce naming conventions for JavaScript and TypeScript filenames.",
|
|
1403
|
+
"anyOf": [
|
|
1404
|
+
{ "$ref": "#/definitions/RuleConfiguration" },
|
|
1405
|
+
{ "type": "null" }
|
|
1406
|
+
]
|
|
1407
|
+
},
|
|
1408
|
+
"useForOf": {
|
|
1409
|
+
"description": "This rule recommends a for-of loop when in a for loop, the index used to extract an item from the iterated array.",
|
|
1410
|
+
"anyOf": [
|
|
1411
|
+
{ "$ref": "#/definitions/RuleConfiguration" },
|
|
1412
|
+
{ "type": "null" }
|
|
1413
|
+
]
|
|
1414
|
+
},
|
|
1182
1415
|
"useGroupedTypeImport": {
|
|
1183
1416
|
"description": "Enforce the use of import type when an import only has specifiers with type qualifier.",
|
|
1184
1417
|
"anyOf": [
|
|
@@ -1193,15 +1426,29 @@
|
|
|
1193
1426
|
{ "type": "null" }
|
|
1194
1427
|
]
|
|
1195
1428
|
},
|
|
1196
|
-
"
|
|
1197
|
-
"description": "
|
|
1429
|
+
"useImportType": {
|
|
1430
|
+
"description": "Promotes the use of import type for types.",
|
|
1198
1431
|
"anyOf": [
|
|
1199
1432
|
{ "$ref": "#/definitions/RuleConfiguration" },
|
|
1200
1433
|
{ "type": "null" }
|
|
1201
1434
|
]
|
|
1202
1435
|
},
|
|
1203
|
-
"
|
|
1204
|
-
"description": "
|
|
1436
|
+
"useNodejsImportProtocol": {
|
|
1437
|
+
"description": "Enforces using the node: protocol for Node.js builtin modules.",
|
|
1438
|
+
"anyOf": [
|
|
1439
|
+
{ "$ref": "#/definitions/RuleConfiguration" },
|
|
1440
|
+
{ "type": "null" }
|
|
1441
|
+
]
|
|
1442
|
+
},
|
|
1443
|
+
"useNumberNamespace": {
|
|
1444
|
+
"description": "Use the Number properties instead of global ones.",
|
|
1445
|
+
"anyOf": [
|
|
1446
|
+
{ "$ref": "#/definitions/RuleConfiguration" },
|
|
1447
|
+
{ "type": "null" }
|
|
1448
|
+
]
|
|
1449
|
+
},
|
|
1450
|
+
"useShorthandFunctionType": {
|
|
1451
|
+
"description": "Enforce using function types instead of object type with call signatures.",
|
|
1205
1452
|
"anyOf": [
|
|
1206
1453
|
{ "$ref": "#/definitions/RuleConfiguration" },
|
|
1207
1454
|
{ "type": "null" }
|
|
@@ -1295,6 +1542,13 @@
|
|
|
1295
1542
|
"OverridePattern": {
|
|
1296
1543
|
"type": "object",
|
|
1297
1544
|
"properties": {
|
|
1545
|
+
"css": {
|
|
1546
|
+
"description": "Specific configuration for the Css language",
|
|
1547
|
+
"anyOf": [
|
|
1548
|
+
{ "$ref": "#/definitions/CssConfiguration" },
|
|
1549
|
+
{ "type": "null" }
|
|
1550
|
+
]
|
|
1551
|
+
},
|
|
1298
1552
|
"formatter": {
|
|
1299
1553
|
"description": "Specific configuration for the Json language",
|
|
1300
1554
|
"anyOf": [
|
|
@@ -1386,9 +1640,21 @@
|
|
|
1386
1640
|
"allOf": [{ "$ref": "#/definitions/ComplexityOptions" }]
|
|
1387
1641
|
},
|
|
1388
1642
|
{
|
|
1389
|
-
"description": "Options for `
|
|
1643
|
+
"description": "Options for `useConsistentArrayType` rule",
|
|
1644
|
+
"allOf": [{ "$ref": "#/definitions/ConsistentArrayTypeOptions" }]
|
|
1645
|
+
},
|
|
1646
|
+
{
|
|
1647
|
+
"description": "Options for `useFilenamingConvention` rule",
|
|
1648
|
+
"allOf": [{ "$ref": "#/definitions/FilenamingConventionOptions" }]
|
|
1649
|
+
},
|
|
1650
|
+
{
|
|
1651
|
+
"description": "Options for `useExhaustiveDependencies` rule",
|
|
1390
1652
|
"allOf": [{ "$ref": "#/definitions/HooksOptions" }]
|
|
1391
1653
|
},
|
|
1654
|
+
{
|
|
1655
|
+
"description": "Deprecated options for `useHookAtTopLevel` rule",
|
|
1656
|
+
"allOf": [{ "$ref": "#/definitions/DeprecatedHooksOptions" }]
|
|
1657
|
+
},
|
|
1392
1658
|
{
|
|
1393
1659
|
"description": "Options for `useNamingConvention` rule",
|
|
1394
1660
|
"allOf": [{ "$ref": "#/definitions/NamingConventionOptions" }]
|
|
@@ -1535,6 +1801,13 @@
|
|
|
1535
1801
|
{ "type": "null" }
|
|
1536
1802
|
]
|
|
1537
1803
|
},
|
|
1804
|
+
"noDefaultExport": {
|
|
1805
|
+
"description": "Disallow default exports.",
|
|
1806
|
+
"anyOf": [
|
|
1807
|
+
{ "$ref": "#/definitions/RuleConfiguration" },
|
|
1808
|
+
{ "type": "null" }
|
|
1809
|
+
]
|
|
1810
|
+
},
|
|
1538
1811
|
"noImplicitBoolean": {
|
|
1539
1812
|
"description": "Disallow implicit true values on JSX boolean attributes",
|
|
1540
1813
|
"anyOf": [
|
|
@@ -1948,6 +2221,13 @@
|
|
|
1948
2221
|
{ "type": "null" }
|
|
1949
2222
|
]
|
|
1950
2223
|
},
|
|
2224
|
+
"noImplicitAnyLet": {
|
|
2225
|
+
"description": "Disallow use of implicit any type on variable declarations.",
|
|
2226
|
+
"anyOf": [
|
|
2227
|
+
{ "$ref": "#/definitions/RuleConfiguration" },
|
|
2228
|
+
{ "type": "null" }
|
|
2229
|
+
]
|
|
2230
|
+
},
|
|
1951
2231
|
"noImportAssign": {
|
|
1952
2232
|
"description": "Disallow assigning to imported bindings",
|
|
1953
2233
|
"anyOf": [
|
|
@@ -2125,6 +2405,10 @@
|
|
|
2125
2405
|
{ "type": "null" }
|
|
2126
2406
|
]
|
|
2127
2407
|
},
|
|
2408
|
+
"defaultBranch": {
|
|
2409
|
+
"description": "The main branch of the project",
|
|
2410
|
+
"type": ["string", "null"]
|
|
2411
|
+
},
|
|
2128
2412
|
"enabled": {
|
|
2129
2413
|
"description": "Whether Biome should integrate itself with the VCS client",
|
|
2130
2414
|
"type": ["boolean", "null"]
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@biomejs/biome","version":"1.
|
|
1
|
+
{"name":"@biomejs/biome","version":"1.5.1","bin":"bin/biome","scripts":{"postinstall":"node scripts/postinstall.js"},"homepage":"https://biomejs.dev","repository":{"type":"git","url":"https://github.com/biomejs/biome.git","directory":"packages/@biomejs/biome"},"author":"Emanuele Stoppa","license":"MIT OR Apache-2.0","bugs":"https://github.com/biomejs/biome/issues","description":"Biome is a toolchain for the web: formatter, linter and more","files":["bin/biome","scripts/postinstall.js","configuration_schema.json","README.md","LICENSE-APACHE","LICENSE-MIT","ROME-LICENSE-MIT"],"keywords":["JavaScript","TypeScript","format","lint","toolchain","JSON"],"engines":{"node":">=14.*"},"funding":{"type":"opencollective","url":"https://opencollective.com/biome"},"optionalDependencies":{"@biomejs/cli-win32-x64":"1.5.1","@biomejs/cli-win32-arm64":"1.5.1","@biomejs/cli-darwin-x64":"1.5.1","@biomejs/cli-darwin-arm64":"1.5.1","@biomejs/cli-linux-x64":"1.5.1","@biomejs/cli-linux-arm64":"1.5.1","@biomejs/cli-linux-x64-musl":"1.5.1","@biomejs/cli-linux-arm64-musl":"1.5.1"}}
|
package/scripts/postinstall.js
CHANGED
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
const { platform, arch } = process;
|
|
2
|
+
const { execSync } = require("child_process");
|
|
3
|
+
|
|
4
|
+
function isMusl() {
|
|
5
|
+
let stderr;
|
|
6
|
+
try {
|
|
7
|
+
stderr = execSync("ldd --version", {
|
|
8
|
+
stdio: ['pipe', 'pipe', 'pipe']
|
|
9
|
+
});
|
|
10
|
+
} catch (err) {
|
|
11
|
+
stderr = err.stderr;
|
|
12
|
+
}
|
|
13
|
+
if (stderr.indexOf("musl") > -1) {
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
2
18
|
|
|
3
19
|
const PLATFORMS = {
|
|
4
20
|
win32: {
|
|
@@ -13,9 +29,17 @@ const PLATFORMS = {
|
|
|
13
29
|
x64: "@biomejs/cli-linux-x64/biome",
|
|
14
30
|
arm64: "@biomejs/cli-linux-arm64/biome",
|
|
15
31
|
},
|
|
32
|
+
"linux-musl": {
|
|
33
|
+
x64: "@biomejs/cli-linux-x64-musl/biome",
|
|
34
|
+
arm64: "@biomejs/cli-linux-arm64-musl/biome",
|
|
35
|
+
},
|
|
16
36
|
};
|
|
17
37
|
|
|
18
|
-
const binName =
|
|
38
|
+
const binName =
|
|
39
|
+
platform === "linux" && isMusl()
|
|
40
|
+
? PLATFORMS?.["linux-musl"]?.[arch]
|
|
41
|
+
: PLATFORMS?.[platform]?.[arch];
|
|
42
|
+
|
|
19
43
|
if (binName) {
|
|
20
44
|
let binPath;
|
|
21
45
|
try {
|