Skip to content

Plugin does not work with NodeJS 22: Unexpected identifier 'assert' #2482

@janthomasQS

Description

@janthomasQS

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

When you import this plugin in your eslint config and use nodejs 22 eslint will always crash. You do not have to use the plugin itself. It only needs to be imported

To Reproduce Steps to reproduce the behavior:

  • import this plugin into your eslint.config.js
  • run eslint
  • it crashes with SyntaxError: Unexpected identifier 'assert'

Expected behavior

Environment:

  • OS: Windows 11
  • @graphql-eslint/eslint-plugin: 4.0.0-alpha.3
  • Node.js: 22.5.1

Additional context

NodeJS has removed support for "assert" here: nodejs/node#52104
The feature is used in https://github.com/dimaMachina/graphql-eslint/blame/master/packages/plugin/src/meta.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugBug :-(stage/6-releasedThe issue has been solved on a released version of the library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions