graphql-eslint: Operations inside graphql`` statements are not being linted
Not sure if this is a bug or just a feature: I have .graphql schema files being properly linted, but we use relay and our operations are defined inside graphql statements rather than gql and it seems the linter isn’t finding them. I was sure to add the following as an override per the instructions:
{
files: ['*.tsx', '*.ts'],
processor: '@graphql-eslint/graphql',
},
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 16 (5 by maintainers)
Can we document this in
README? I wasted 2 hours to find this issue and fix the same problem.@B2o5T I was able to fix the issue on my end; we initialize ESLint at a point in our front end linting workflow and .graphql needed to be added to the
extensionsproperty array. Thanks for trying to help.@Dodie324 I had the same issue with the following eslint configuration file and lint command:
.eslintrc.js:lintcommand:There were two problems:
.eslintrc.jsis:.graphqlextension to the--extof the lint command (I think @BrianBusby meant this!). However, we could completely eliminate the extensions with the new configuration, so the new lint command would be:eslint src/.I hope it helps you!
Having similar issues as @BrianBusby. I’m trying to migrate from
eslint-plugin-graphql, but not sure this package is actually validating my queries/mutations written inside a.tsfile.Here is my config setup:
Take a look of this example with code files https://github.com/B2o5T/graphql-eslint/blob/master/examples/code-file/.eslintrc.cjs You have an incorrect eslint configuration, split it to overrides sections