JSPM

  • Created
  • Published
  • Downloads 84363
  • Score
    100M100P100Q166767F
  • License MIT

ESLint plugin for Relay.

Package Exports

  • eslint-plugin-relay

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (eslint-plugin-relay) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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.