You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-2Lines changed: 12 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,9 +18,7 @@ module.exports = {
18
18
// Other eslint properties here
19
19
rules: {
20
20
'relay/graphql-syntax':'error',
21
-
'relay/compat-uses-vars':'warn',
22
21
'relay/graphql-naming':'error',
23
-
'relay/generated-flow-types':'warn',
24
22
'relay/must-colocate-fragment-spreads':'warn',
25
23
'relay/no-future-added-value':'warn',
26
24
'relay/unused-fields':'warn',
@@ -42,6 +40,18 @@ Add `plugin:relay/recommended` or `plugin:relay/strict` in `extends`:
42
40
}
43
41
```
44
42
43
+
### Rule Descriptions
44
+
45
+
Brief descriptions for each rule:
46
+
47
+
-`relay/graphql-syntax`: Ensures each `graphql\`\`` tagged template literal contains syntactically valid GraphQL. This is also validated by the Relay Compiler, but the ESLint plugin can often provide faster feedback.
48
+
-`relay/graphql-naming`: Ensures GraphQL fragments and queries follow Relay's naming conventions. This is also validated by the Relay Compiler, but the ESLint plugin can often provide faster feedback.
49
+
-`relay/no-future-added-value`: Ensures code does not try to explicitly handle the `"%future added value"` enum variant which Relay inserts as a placeholder to ensure you handle the possibility that new enum variants may be added by the server after your application has been deployed.
50
+
-`relay/unused-fields`: Ensures that every GraphQL field referenced is used within the module that includes it. This helps enable Relay's [optimal data fetching](https://relay.dev/blog/2023/10/24/how-relay-enables-optimal-data-fetching/)
51
+
-`relay/function-required-argument`: Ensures that `readInlineData` is always passed an explicit argument even though that argument is allowed to be `undefined` at runtime.
52
+
-`relay/hook-required-argument`: Ensures that Relay hooks are always passed an explicit argument even though that argument is allowed to be `undefined` at runtime.
53
+
-`relay/must-colocate-fragment-spreads`: Ensures that when a fragment spread is added within a module, that module directly imports the module which defines that fragment. This prevents the anti-pattern when one component fetches a fragment that is not used by a direct child component. **Note**: This rule leans heavily on Meta's globally unique module names. It likely won't work well in other environments.
54
+
45
55
### Suppressing rules within graphql tags
46
56
47
57
The following rules support suppression within graphql tags:
0 commit comments