Skip to content

Commit b84f13a

Browse files
committed
Set up eslint-plugin-graphql
1 parent dd13c9b commit b84f13a

File tree

10 files changed

+12027
-9
lines changed

10 files changed

+12027
-9
lines changed

.eslintrc

Lines changed: 0 additions & 6 deletions
This file was deleted.

.eslintrc.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module.exports = {
2+
extends: 'react-app',
3+
plugins: ['graphql'],
4+
parser: 'babel-eslint',
5+
rules: {
6+
'graphql/template-strings': [
7+
'error',
8+
{
9+
env: 'apollo',
10+
schemaJson: require('./schema.json')
11+
},
12+
{
13+
env: 'apollo',
14+
tagName: 'spaceql',
15+
schemaJson: require('./spacex.json')
16+
}
17+
]
18+
}
19+
}

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@
5252
"eject": "react-scripts eject",
5353
"now-start": "serve --single ./build",
5454
"deploy": "now",
55-
"alias": "pbpaste | xargs -I % now alias % staging.graphql.guide"
55+
"alias": "pbpaste | xargs -I % now alias % staging.graphql.guide",
56+
"lint": "eslint src/",
57+
"update-schema": "graphql get-schema -e https://api.graphql.guide/graphql -o schema.json",
58+
"update-schema-spacex": "graphql get-schema -e https://api.spacex.land/graphql -o spacex.json"
5659
}
5760
}

0 commit comments

Comments
 (0)