File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 1
1
## Available Rules
2
2
3
3
4
+ - [ ` avoid-typename-prefix ` ] ( ./rules/avoid-typename-prefix.md )
4
5
- [ ` no-unreachable-types ` ] ( ./rules/no-unreachable-types.md )
5
6
- [ ` no-deprecated ` ] ( ./rules/no-deprecated.md )
6
7
- [ ` unique-fragment-name ` ] ( ./rules/unique-fragment-name.md )
Original file line number Diff line number Diff line change
1
+ # ` avoid-typename-prefix `
2
+
3
+ - Category: ` Best Practices `
4
+ - Rule name: ` @graphql-eslint/avoid-typename-prefix `
5
+ - Requires GraphQL Schema: ` false ` [ ℹ️] ( ../../README.md#extended-linting-rules-with-graphql-schema )
6
+ - Requires GraphQL Operations: ` false ` [ ℹ️] ( ../../README.md#extended-linting-rules-with-siblings-operations )
7
+
8
+ Enforces users to avoid using the type name in a field name while defining your schema.
9
+
10
+ ## Usage Examples
11
+
12
+ ### Incorrect
13
+
14
+ ``` graphql
15
+ # eslint @graphql-eslint/avoid-typename-prefix: ["error"]
16
+
17
+ type User {
18
+ userId : ID !
19
+ }
20
+ ```
21
+
22
+ ### Correct
23
+
24
+ ```graphql
25
+ # eslint @graphql-eslint/avoid-typename-prefix: ["error"]
26
+
27
+ type User {
28
+ id : ID !
29
+ }
30
+ ```
You can’t perform that action at this time.
0 commit comments