mjmahone / eslint-plugin-relay

A plugin for the code linter ESLint to lint specific details about Relay.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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']
};

Contribute

We actively welcome pull requests, learn how to contribute.

License

eslint-plugin-relay is BSD licensed. We also provide an additional patent grant.

About

A plugin for the code linter ESLint to lint specific details about Relay.

License:Other


Languages

Language:JavaScript 100.0%