Skip to content

noQuickfixBiome

¥Summary

¥How to configure

biome.json
{
"linter": {
"rules": {
"suspicious": {
"noQuickfixBiome": "error"
}
}
}
}

¥Description

禁止在编辑器设置文件中使用 if quickfix.biome

¥Disallow the use if quickfix.biome inside editor settings file.

代码操作 quickfix.biome 可能有害,因为它指示编辑器以原子方式应用 lint 规则和代码操作的代码修复。如果多个规则或操作对同一代码段应用代码修复,编辑器将输出无效代码。

¥The code action quickfix.biome can be harmful because it instructs the editors to apply the code fix of lint rules and code actions atomically. If multiple rules or actions apply a code fix to the same code span, the editor will emit invalid code.

该规则专门针对 VSCode 设置和 Zed 设置。具体来说,路径以以下形式结尾:

¥The rule targets specifically VSCode settings and Zed settings. Specifically, paths that end with:

  • .vscode/settings.json

  • Code/User/settings.json

  • .zed/settings.json

  • zed/settings.json

¥Examples

¥Invalid

{
"quickfix.biome": "explicit"
}

¥Valid

{
"source.fixAll.biome": "explicit"
}

¥Options

以下选项可用

¥The following options are available

如果你的编辑器使用的 JSON 文件设置不受此规则原生支持,则可以指定 JSON 路径列表。

¥It’s possible to specify a list of JSON paths, if your editor uses a JSON file setting that isn’t supported natively by the rule.

例如,如果你的编辑器使用名为 .myEditor/file.json 的文件,你可以将 ".myEditor/file.json" 添加到列表中。该规则检查文件是否以给定的路径结尾。

¥If your editor uses, for example, a file called .myEditor/file.json, you can add ".myEditor/file.json" to the list. The rule checks if the file ends with the given paths.

biome.json
{
"linter": {
"rules": {
"suspicious": {
"noQuickfixBiome": {
"options": {
"additionalPaths": [
".myEditor/file.json"
]
}
}
}
}
}
}

¥Related links