useConsistentGraphqlDescriptions
¥Summary
-
规则生效日期:
v2.3.6¥Rule available since:
v2.3.6 -
诊断类别:
lint/nursery/useConsistentGraphqlDescriptions¥Diagnostic Category:
lint/nursery/useConsistentGraphqlDescriptions -
此规则没有修复方案。
¥This rule doesn’t have a fix.
-
此规则的默认严重级别为 information。
¥The default severity of this rule is information.
-
来源:
¥Sources:
¥How to configure
{ "linter": { "rules": { "nursery": { "useConsistentGraphqlDescriptions": "error" } } }}¥Description
要求所有描述遵循相同的样式(块级或行内),以保持一致性并提高整个模式的可读性。
¥Require all descriptions to follow the same style (either block or inline) to maintain consistency and improve readability across the schema.
¥Examples
样式:block
Section titled “样式:block”¥style: block
¥Invalid
enum EnumValue { "this is a description" DEFAULT}code-block.graphql:2:3 lint/nursery/useConsistentGraphqlDescriptions ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ℹ Unexpected inline description style.
1 │ enum EnumValue {
> 2 │ “this is a description”
│ ^^^^^^^^^^^^^^^^^^^^^^^
3 │ DEFAULT
4 │ }
ℹ To stay consistent within the project, write the description block style.
¥Valid
enum EnumValue { """ this is a description """ DEFAULT}¥Options
此选项将指定描述样式。
¥This option will specify the description style.
-
"block":要求代码块描述使用三引号 ("""...""")。¥
"block": Requires triple-quoted block descriptions ("""...""") -
"inline":要求行内描述使用单引号 ("...")。¥
"inline": Requires single-quoted inline descriptions ("...")
默认 "block"
¥Default "block"
{ "linter": { "rules": { "nursery": { "useConsistentGraphqlDescriptions": { "options": { "style": "inline" } } } } }}enum EnumValue { """ this is a description """ DEFAULT}¥Related links
Biome v2.1 中文网 - 粤ICP备13048890号