@gabehayes/eslint-config-graphql
Check out [eslint-plugin-graphql](https://github.com/apollographql/eslint-plugin-graphql) and please explain it to me.
Last updated 3 years ago by gabehayes .
MIT · Original npm · Tarball · package.json
$ cnpm install @gabehayes/eslint-config-graphql 
SYNC missed versions from official npm registry.

eslint-config-graphql

Check out eslint-plugin-graphql and please explain it to me.

Table of Contents

  1. Installation
  2. Rules
    1. graphql/template-strings

Installation

Install the package.

yarn add @keenai/eslint-config-graphql

Then, extend @keenai/react in your ESLint configuration file.

{
  extends: [
    '@keenai/graphql',
  ],
}

Rules

graphql/template-strings

Okay, so there are a couple assumptions occurring in this configuration.

  1. You have a schema.json file in the root of your project. I use apollo-codegen to generate my schema.
  2. Your GraphQL queries live in literal files.

If both of these apply to you, you may proceed.

You have to update your linter to look at new file extensions, such as .gql or .graphql, whatever applies to your case.

From the command line, it would be something like:

eslint . --ext .js --ext .gql --ext .graphql

If you lint in your IDE, be sure that it's also configured to lint your query files.

If you use Atom, for example, you need to update the settings in linter-eslint and update the list of scopes to run ESLint on to the following:

source.js, source.jsx, source.js.jsx, source.babel, source.js-semantic, source.gql, source.graphql

Current Tags

  • 0.1.2                                ...           latest (3 years ago)

4 Versions

  • 0.1.2                                ...           3 years ago
  • 0.1.2-0                                ...           3 years ago
  • 0.1.1                                ...           3 years ago
  • 0.1.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 4
Dependencies (2)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |