mirror of
https://github.com/JamesIves/github-pages-deploy-action.git
synced 2023-12-15 20:03:39 +08:00
.. | ||
src | ||
eslint-plugin-relay.js | ||
LICENSE | ||
package.json | ||
README.md |
eslint-plugin-relay
eslint-plugin-relay
is a plugin for ESLint to catch common problems in code using Relay early.
Install
npm i --save-dev eslint-plugin-relay
How To Use
- 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': 'warn',
'relay/graphql-naming': 'error',
'relay/generated-flow-types': 'warn',
'relay/no-future-added-value': 'warn',
'relay/unused-fields': 'warn'
},
plugins: ['relay']
};
You can also enable all the recommended or strict rules at once.
Add plugin:relay/recommended
or plugin:relay/strict
in extends
:
{
"extends": [
"plugin:relay/recommended"
]
}
Contribute
We actively welcome pull requests, learn how to contribute.
License
eslint-plugin-relay
is MIT licensed.