Skip to content

Commit 5b718c0

Browse files
committed
update docs
1 parent e1c9ced commit 5b718c0

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

docs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## Available Rules
22

33

4+
- [`avoid-typename-prefix`](./rules/avoid-typename-prefix.md)
45
- [`no-unreachable-types`](./rules/no-unreachable-types.md)
56
- [`no-deprecated`](./rules/no-deprecated.md)
67
- [`unique-fragment-name`](./rules/unique-fragment-name.md)

docs/rules/avoid-typename-prefix.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
```

0 commit comments

Comments
 (0)