@biomejs/biome 1.3.3 → 1.4.1-nightly.22dd4e1

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.
@@ -0,0 +1,115 @@
1
+ <p align="center">
2
+ <img alt="Biome - Toolchain of the web"
3
+ src="https://raw.githubusercontent.com/biomejs/resources/main/biome-logo-slogan.svg"
4
+ width="400">
5
+ </p>
6
+
7
+ <div align="center">
8
+
9
+ [![Discord chat][discord-badge]][discord-url]
10
+ [![CI on main][ci-badge]][ci-url]
11
+ [![npm version][npm-badge]][npm-url]
12
+ [![VSCode version][vscode-badge]][vscode-url]
13
+ [![Open VSX version][open-vsx-badge]][open-vsx-url]
14
+
15
+ [discord-badge]: https://badgen.net/discord/online-members/BypW39g6Yc?icon=discord&label=discord&color=green
16
+ [discord-url]: https://discord.gg/BypW39g6Yc
17
+ [ci-badge]: https://github.com/biomejs/biome/actions/workflows/main.yml/badge.svg
18
+ [ci-url]: https://github.com/biomejs/biome/actions/workflows/main.yml
19
+ [npm-badge]: https://badgen.net/npm/v/@biomejs/biome?icon=npm&color=green&label=%40biomejs%2Fbiome
20
+ [npm-url]: https://www.npmjs.com/package/@biomejs/biome/v/latest
21
+ [vscode-badge]: https://badgen.net/vs-marketplace/v/biomejs.biome?label=vscode&icon=visualstudio&color=green
22
+ [vscode-url]: https://marketplace.visualstudio.com/items?itemName=biomejs.biome
23
+ [open-vsx-badge]: https://badgen.net/open-vsx/version/biomejs/biome?label=open-vsx&color=green
24
+ [open-vsx-url]: https://open-vsx.org/extension/biomejs/biome
25
+
26
+ </div>
27
+
28
+ <div align="center">
29
+
30
+ [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)
31
+
32
+ </div>
33
+
34
+ **Biome** 是一个用于 Web 项目的高性能工具链,旨在为开发者提供维护项目的工具。
35
+
36
+ **Biome 是一个[快速的格式化工具](./benchmark#formatting)**,适用于 _JavaScript_、_TypeScript_、_JSX_、_JSON_ 等,与 _Prettier_ 的兼容性达到了 **[97%](https://console.algora.io/challenges/prettier)**。
37
+
38
+ **Biome 是一个[高性能的 Linter](https://github.com/biomejs/biome/tree/main/benchmark#linting)**,适用于 _JavaScript_、_TypeScript_、_JSX_ 等,包含了来自 ESLint、TypeScript ESLint 和[其他来源](https://github.com/biomejs/biome/discussions/3)的 **[170 余项规则](https://biomejs.dev/zh-cn/linter/rules/)**。它**输出详细且有上下文诊断信息**,能帮助你优化代码,成为一名更好的程序员!
39
+
40
+ **Biome** 从一开始就设计为[在编辑器中交互式使用](https://biomejs.dev/zh-cn/guides/integrate-in-editor/)。它可以在你编写代码时格式化并检查出不规范的代码。
41
+
42
+ ### 安装
43
+
44
+ ```shell
45
+ npm install --save-dev --save-exact @biomejs/biome
46
+ ```
47
+
48
+ ### 使用
49
+
50
+ ```shell
51
+ # 格式化文件
52
+ npx @biomejs/biome format --write ./src
53
+
54
+ # Lint 文件
55
+ npx @biomejs/biome lint ./src
56
+
57
+ # 运行格式化,Lint 等,并应用安全的建议
58
+ npx @biomejs/biome check --apply ./src
59
+
60
+ # 在 CI 环境中检查所有文件是否符合格式,Lint 等
61
+ npx @biomejs/biome ci ./src
62
+ ```
63
+
64
+ 如果你想在不安装的情况下试用 Biome,可以使用[在线 playground](https://biomejs.dev/playground/),它被编译为 WebAssembly。
65
+
66
+ ## 文档
67
+
68
+ 查看我们的[主页][biomejs]以了解更多关于 Biome 的信息,或者直接前往[入门指南][getting-started]开始使用 Biome。
69
+
70
+ ## 更多信息
71
+
72
+ **Biome** 有合理的默认设置,不需要配置。
73
+
74
+ **Biome** 旨在支持[所有主要的现代网络开发语言][language-support]。
75
+
76
+ **Biome** [不需要 Node.js](https://biomejs.dev/zh-cn/guides/manual-installation/) 就可以运行。
77
+
78
+ **Biome** 有一流的 LSP 支持,具有精密的解析器,可以完全保真地表示源文本,并具有顶级的错误恢复能力。
79
+
80
+ **Biome** 统一了以前分散的功能。基于共享的基础,我们可以提供一个处理代码、显示错误、并行工作、缓存和配置的一致体验。
81
+
82
+ 阅读更多关于我们的[项目理念][biome-philosophy]。
83
+
84
+ **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) 下进行管理。
85
+
86
+ ## 赞助商
87
+
88
+ ### 金牌赞助商
89
+
90
+ <table>
91
+ <tbody>
92
+ <tr>
93
+ <td align="center" valign="middle">
94
+ <a href="https://shiguredo.jp/" target="_blank"><img src="https://shiguredo.jp/official_shiguredo_logo.svg" height="120"></a>
95
+ </td>
96
+ </tr>
97
+ </tbody>
98
+ </table>
99
+
100
+ ### 铜牌赞助商
101
+
102
+ <table>
103
+ <tbody>
104
+ <tr>
105
+ <td align="center" valign="middle">
106
+ <a href="https://www.kanamekey.com" target="_blank"><img src="https://images.opencollective.com/kaname/d15fd98/logo/256.png?height=80" width="80"></a>
107
+ </td>
108
+ </tr>
109
+ </tbody>
110
+ </table>
111
+
112
+ [biomejs]: https://biomejs.dev/zh-cn/
113
+ [biome-philosophy]: https://biomejs.dev/zh-cn/internals/philosophy/
114
+ [language-support]: https://biomejs.dev/zh-cn/internals/language-support/
115
+ [getting-started]: https://biomejs.dev/zh-cn/guides/getting-started/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020-2023 Rome Tools is Rome Tools, Inc. and its affiliates.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
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 || PLATFORMS?.[platform]?.[arch];
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(