Skip to content

Support Oxlint via an Oxlint JavaScript plugin #2960

Open

Description

@ya2s

Is your feature request related to a problem? Please describe.

I would like to use @graphql-eslint/eslint-plugin rules in projects that are adopting Oxlint.

Currently, GraphQL-specific linting relies on ESLint. This works well, but teams that are moving part of their linting pipeline to Oxlint cannot reuse the existing GraphQL ESLint rules there. As a result, we either need to keep ESLint only for GraphQL linting or lose GraphQL-specific lint checks in the Oxlint workflow.

This creates friction for projects that want faster linting while still keeping GraphQL validation and best practices enforced.

Describe the solution you'd like

I would like @graphql-eslint/eslint-plugin to provide support for Oxlint.

My assumption is that this could be implemented using the Oxlint JavaScript plugin API, exposing GraphQL ESLint rules in a way that Oxlint can execute.

Ideally, the package would provide one of the following:

  • an Oxlint-compatible plugin entry point
  • a separate package such as @graphql-eslint/oxlint-plugin
  • documentation showing how to use GraphQL ESLint rules from Oxlint, if this is already possible

The goal is not necessarily to replace ESLint support, but to make GraphQL linting available for users who are adopting Oxlint.

Describe alternatives you've considered

The current alternative is to continue running ESLint in parallel with Oxlint, using ESLint only for GraphQL-related rules.

That works, but it has some downsides:

  • maintaining two linting tools in the same project
  • duplicated configuration and CI setup
  • slower linting compared with an Oxlint-first workflow
  • inconsistent developer experience between JavaScript/TypeScript linting and GraphQL linting

Another alternative is to disable GraphQL-specific linting when moving to Oxlint, but that would reduce safety and remove useful schema/query validation.

Additional context

Oxlint is increasingly being adopted as a fast linting tool for JavaScript and TypeScript projects.

GraphQL projects would benefit from being able to keep rules from @graphql-eslint/eslint-plugin while adopting Oxlint.

I understand that not all ESLint rule APIs may map directly to Oxlint. Even partial support for rules that can be implemented through the Oxlint JavaScript plugin API would be very helpful.

Activity

  1. ya2s commented on Aug 28, 2026

    @ya2s
    Author

    As a stopgap while this is being considered upstream, I published a third-party plugin that runs @graphql-eslint/eslint-plugin rules inside oxlint through oxlint's JS-plugin API:

    It doesn't reimplement any rules — @graphql-eslint/eslint-plugin and graphql are peer dependencies, so your installed version is what actually runs. The plugin provides the SourceCode/rule-runner surface the rules expect, extracts embedded GraphQL with the same graphql-tag-pluck-based extraction graphql-eslint itself uses, and maps diagnostics and fixes back onto host-file coordinates.

    // oxlint.config.ts
    import { defineConfig } from "oxlint";
    
    export default defineConfig({
      jsPlugins: ["oxlint-plugin-graphql-eslint"],
      rules: {
        "graphql/no-anonymous-operations": "error",
        "graphql/parse-error": "error",
      },
    });

    All 64 upstream rules are exposed as graphql/<same-name>, and all five flat configs are ported. Existing graphql.config.* / .graphqlrc.* files work unchanged.

    Known limits, all documented in the README:

    • .graphql / .gql files are not linted. oxlint has no custom-parser support, so only GraphQL embedded in JS/TS is covered. Standalone documents still need ESLint + graphql-eslint alongside.
    • .vue / .svelte embedded GraphQL is not covered — this is upstream extraction behaviour (the .vue processor rejects the format outright; .svelte needs optional svelte2tsx/svelte), not an oxlint limitation.
    • GraphQL syntax errors surface as a plugin-provided graphql/parse-error rule, since oxlint has no fatal-parse channel for plugins.

    Rule behaviour is diff-checked against real installed eslint + @graphql-eslint/eslint-plugin in CI (graphql-eslint's own documented rule examples run through both engines), currently 0 mismatches.

    I'd still much prefer first-party support — a @graphql-eslint/oxlint-plugin package or an official entry point — and I'm happy to contribute this work upstream in whatever shape maintainers would want it. Sharing it here mainly so anyone hitting this issue has something usable in the meantime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ 换网址