Open alexis-regnaud opened 4 years ago
To catch errors in separate files like .gql or .graphql I followed the hint from the readme https://github.com/apollographql/eslint-plugin-graphql#graphql-literal-files
rules: [
"graphql/template-strings": ['error', {
env: 'literal',
schemaJson: require('./schema.json'),
}]
]
and the linter points out errors in my queries, maybe it will help you too 🤞
The both together :
rules: [
"graphql/template-strings": ['error', {
env: 'literal',
schemaJson: require('./schema.json'),
}]
]
and
extraFileExtensions: ['.gql']
work fine, I have the errors, thanks !
Hi, I am trying to use the
eslint-plugin-graphql
but it doesn't catch my graphql error.Here's my eslintrc.js (I've reduced it to the relevant parts only) :
In order to cause an eslint error I have defined an explicit issue in my file
.gql
(I've reduced it to the relevant parts only):But when I run my
eslint pages/**
I have no error related tographql/template-strings
.So I have used eslint with debug mode :
eslint pages/** --debug
and I have this kind of errors :Eslint parse all .
gql
but it seems have a conflict between@typescript-eslint/parser
andeslint-plugin-graphql
And if I add 'extraFileExtensions: ['.gql']' in my config I have no conflict but still no lint errors as well ..Here my packages version :
Note : The problem is only for separate files, when I use the graphql-tag eslint works well and detect
aFalseField