Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eslint 9 compatibility #2311

Closed
4 tasks
lwasyl opened this issue May 13, 2024 · 2 comments
Closed
4 tasks

Eslint 9 compatibility #2311

lwasyl opened this issue May 13, 2024 · 2 comments
Labels
stage/6-released The issue has been solved on a released version of the library

Comments

@lwasyl
Copy link

lwasyl commented May 13, 2024

Issue workflow progress

Progress of the issue based on the
Contributor Workflow

  • 1. The issue provides a reproduction available on GitHub, Stackblitz or CodeSandbox

    For example, you can start off by editng the
    'basic' example on Stackblitz.

    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: #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

To Reproduce Steps to reproduce the behavior:

Update eslint to version 9

Expected behavior

graphql-eslint still works

Environment:

  • OS: /
  • @graphql-eslint/eslint-plugin: 3.20.1
  • Node.js: 20.13.1

Additional context

@ldiqual
Copy link

ldiqual commented May 31, 2024

Workaround using the compat package from eslint:

import { fixupPluginRules } from '@eslint/compat'
export default [
  {
    plugins: {
      '@graphql-eslint': fixupPluginRules(graphqlPlugin),
    },
    // ...
  }
]

@dimaMachina
Copy link
Owner

#2178 (comment)

@dimaMachina dimaMachina closed this as not planned Won't fix, can't repro, duplicate, stale Jul 31, 2024
@dimaMachina dimaMachina reopened this Jul 31, 2024
@dimaMachina dimaMachina added the stage/6-released The issue has been solved on a released version of the library label Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage/6-released The issue has been solved on a released version of the library
Projects
None yet
Development

No branches or pull requests

3 participants