GraphQL 规则
以下是 Biome 支持的规则列表,按组划分。以下是表情符号的图例:
¥Below the list of rules supported by Biome, divided by group. Here’s a legend of the emojis:
-
图标 表示该规则是推荐规则的一部分。
¥The icon indicates that the rule is part of the recommended rules.
-
图标 表示该规则提供了可以安全应用的代码操作(修复)。
¥The icon indicates that the rule provides a code action (fix) that is safe to apply.
-
图标 表示该规则提供了不安全应用的代码操作(修复)。
¥The icon indicates that the rule provides a code action (fix) that is unsafe to apply.
-
图标 表示该规则已实现并计划在下一个版本中发布。
¥The icon indicates that the rule has been implemented and scheduled for the next release.
correctness
Section titled “correctness”| 规则名称 | 描述 | 属性 |
|---|---|---|
| useGraphqlNamedOperations | 强制要求指定 GraphQL 操作的名称。 |
nursery
Section titled “nursery”| 规则名称 | 描述 | 属性 |
|---|---|---|
| noEmptySource | 禁止使用空源。 | |
| useConsistentGraphqlDescriptions | 要求所有描述遵循相同的样式(块级或行内),以保持一致性并提高整个模式的可读性。 | |
| useDeprecatedDate | 要求 @deprecated 指令指定删除日期。 | |
| useUniqueGraphqlOperationName | 强制 GraphQL 文档中的操作名称必须唯一。 |
| 规则名称 | 描述 | 属性 |
|---|---|---|
| useDeprecatedReason | 要求在使用 @deprecated 指令时指定 reason 参数。 | |
| useGraphqlNamingConvention | 验证所有枚举值是否都已大写。 |
suspicious
Section titled “suspicious”| 规则名称 | 描述 | 属性 |
|---|---|---|
| noDuplicateFields | GraphQL 操作中没有重复的字段。 |
¥Recommended rules
-
useGraphqlNamedOperations(严重性:error)
¥useGraphqlNamedOperations (Severity: error)
-
useDeprecatedReason(严重性:warning)
¥useDeprecatedReason (Severity: warning)
-
noDuplicateFields(严重性:information)
¥noDuplicateFields (Severity: information)
缺少规则?请通过 contributing 至 analyzer 或创建规则建议 此处 来帮助我们。
¥Missing a rule? Help us by contributing to the analyzer or create a rule suggestion here.
Biome v2.1 中文网 - 粤ICP备13048890号