noQuickfixBiome
¥Summary
-
规则生效日期:
v2.1.3¥Rule available since:
v2.1.3 -
诊断类别:
lint/suspicious/noQuickfixBiome¥Diagnostic Category:
lint/suspicious/noQuickfixBiome -
此规则为推荐规则,默认启用。
¥This rule is recommended, which means is enabled by default.
-
此规则包含 safe 修复程序。
¥This rule has a safe fix.
-
此规则的默认严重级别为 information。
¥The default severity of this rule is information.
¥How to configure
{ "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
additionalPaths
Section titled “additionalPaths”如果你的编辑器使用的 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.
{ "linter": { "rules": { "suspicious": { "noQuickfixBiome": { "options": { "additionalPaths": [ ".myEditor/file.json" ] } } } } }}¥Related links
Biome v2.1 中文网 - 粤ICP备13048890号