github-pages-deploy-action/node_modules/eslint-plugin-relay
2020-03-21 17:13:25 -04:00
..
src Dependencies 2020-03-06 22:45:40 -05:00
eslint-plugin-relay.js Dependencies 2020-03-06 22:45:40 -05:00
LICENSE Dependencies 2020-03-06 22:45:40 -05:00
package.json Release 2020-03-21 17:13:25 -04:00
README.md Dependencies 2020-03-06 22:45:40 -05:00

eslint-plugin-relay Build Status npm version

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

  1. Add "relay" to your eslint plugins section.
  2. Add the relay rules such as "relay/graphql-syntax": "error" to your eslint rules 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.