Skip to content

useGraphqlNamingConvention

¥Summary

¥How to configure

biome.json
{
"linter": {
"rules": {
"style": {
"useGraphqlNamingConvention": "error"
}
}
}
}

¥Description

验证所有枚举值是否都已大写。

¥Validates that all enum values are capitalized.

按照 GraphQL 的约定,枚举值全部大写。

¥By convention in GraphQL, enum values are all caps.

¥Examples

¥Invalid

enum MyEnum {
value
}
code-block.graphql:2:2 lint/style/useGraphqlNamingConvention ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Enum values should be in all caps.

1 │ enum MyEnum {
> 2 │ value
^^^^^
3 │ }
4 │

Change the enum value to be in all caps.

¥Valid

enum MyEnum {
VALUE
}

¥Related links