Skip to content

Commit d26e588

Browse files
committed
Update readme
1 parent ad94d47 commit d26e588

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

+18
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,24 @@ Add `plugin:relay/recommended` or `plugin:relay/strict` in `extends`:
4242
}
4343
```
4444

45+
### Suppressing rules within graphql tags
46+
47+
The following rules support suppression within graphql tags:
48+
49+
- relay/unused-fields
50+
- relay/must-colocate-fragment-spreads
51+
52+
Supported rules can be suppressed by adding `# eslint-disable-next-line relay/name-of-rule` to the preceding line:
53+
54+
```js
55+
graphql`fragment foo on Page {
56+
# eslint-disable-next-line relay/must-colocate-fragment-spreads
57+
...unused1
58+
}`
59+
```
60+
61+
Note that only the `eslint-disable-next-line` form of suppression works. `eslint-disable-line` doesn't currently work until graphql-js provides support for [parsing Comment nodes](https://github.com/graphql/graphql-js/issues/2241) in their AST.
62+
4563
## Contribute
4664

4765
We actively welcome pull requests, learn how to [contribute](./CONTRIBUTING.md).

0 commit comments

Comments
 (0)