eslint-plugin-relay
is a plugin for ESLint to catch common problems in code using Relay early.
npm i --save-dev eslint-plugin-relay
- Add
"relay"
to your eslintplugins
section. - Add the relay rules such as
"relay/graphql-syntax": "error"
to your eslintrules
section, see the example for all rules.
Example .eslintrc.js:
module.exports = {
// Other eslint properties here
rules: {
'relay/graphql-syntax': 'error',
'relay/compat-uses-vars': 'warning',
'relay/graphql-naming': 'error',
'relay/generated-flow-types': 'warning',
},
plugins: [
'relay',
]
}
We actively welcome pull requests, learn how to contribute.
eslint-plugin-relay is BSD licensed. We also provide an additional patent grant.