ESLint parser, plugin and set rules for GraphQL (for schema and operations). Easily customizable with custom rules. Integrates with IDEs and modern GraphQL tools.
Please make sure the graphql-eslint version under package.json matches yours.
[ ] 2. A failing test has been provided
[ ] 3. A local solution has been provided
[ ] 4. A pull request is pending review
Describe the bug
There's an open issue to support eslint 9 flat config files: https://github.com/dimaMachina/graphql-eslint/issues/2178. However, even when opting out from flat config via export ESLINT_USE_FLAT_CONFIG=false, graphql-eslint fails with Eslint 9 due to:
TypeError: Error while loading rule '@graphql-eslint/no-unreachable-types': Cannot destructure property 'schema' of 'context.parserServices' as it is undefined.. Iiuc the problem is that several methods have been deprecated and removed in eslint 9, including context.parserServices which graphql-eslint seems to be calling. Thus it's not only not possible to use flat config, but eslint 9 at all
Issue workflow progress
Progress of the issue based on the Contributor Workflow
[ ] 1. The issue provides a reproduction available on GitHub, Stackblitz or CodeSandbox
[ ] 2. A failing test has been provided
[ ] 3. A local solution has been provided
[ ] 4. A pull request is pending review
Describe the bug
There's an open issue to support eslint 9 flat config files: https://github.com/dimaMachina/graphql-eslint/issues/2178. However, even when opting out from flat config via
export ESLINT_USE_FLAT_CONFIG=false
, graphql-eslint fails with Eslint 9 due to:TypeError: Error while loading rule '@graphql-eslint/no-unreachable-types': Cannot destructure property 'schema' of 'context.parserServices' as it is undefined.
. Iiuc the problem is that several methods have been deprecated and removed in eslint 9, includingcontext.parserServices
which graphql-eslint seems to be calling. Thus it's not only not possible to use flat config, but eslint 9 at allTo Reproduce Steps to reproduce the behavior:
Update eslint to version 9
Expected behavior
graphql-eslint still works
Environment:
@graphql-eslint/eslint-plugin
: 3.20.1Additional context