noDuplicateEnumValueNames
Summary
Section titled “Summary”- Diagnostic Category:
lint/nursery/noDuplicateEnumValueNames - This rule doesn’t have a fix.
- The default severity of this rule is information.
- Sources:
How to configure
Section titled “How to configure”{ "linter": { "rules": { "nursery": { "noDuplicateEnumValueNames": "error" } } }}Description
Section titled “Description”Require all enum value names to be unique.
A GraphQL enum type is only valid if all its values are uniquely named.
The enum value names are case insensitive, meaning TEST & Test are seen as the same enum value name.
Examples
Section titled “Examples”Invalid
Section titled “Invalid”enum A { TEST OTHER TEST}code-block.graphql:3:8 lint/nursery/noDuplicateEnumValueNames ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ℹ Duplicate enum value name.
1 │ enum A {
2 │ TEST
> 3 │ OTHER
│
> 4 │ TEST
│ ^^^^
5 │ }
6 │
ℹ A GraphQL enum type is only valid if all its values are uniquely named. Make sure to name every enum value differently.
ℹ This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.
enum B { TEST TesT}code-block.graphql:2:7 lint/nursery/noDuplicateEnumValueNames ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ℹ Duplicate enum value name.
1 │ enum B {
> 2 │ TEST
│
> 3 │ TesT
│ ^^^^
4 │ }
5 │
ℹ A GraphQL enum type is only valid if all its values are uniquely named. Make sure to name every enum value differently.
ℹ This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.
enum A { TEST OTHER}Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.