Skip to Content
🚧 This is WIP documentation for v4 of the plugin. For v3 click here.
ESLGraphQL-ESLint

Usage

Quickstart

Installation

Install the plugin package with your favourite package manager.

npm i -D @graphql-eslint/eslint-plugin
⚠️
Warning

Make sure you have graphql dependency in your project.

Configuration

Create a new configuration object in your eslint.config.js file to setup @graphql-eslint plugin.

eslint.config.js
import graphqlPlugin from '@graphql-eslint/eslint-plugin'
 
export default [
  // ... other config
  {
    files: ['**/*.graphql'],
    languageOptions: {
      parser: graphqlPlugin.parser
    },
    plugins: {
      '@graphql-eslint': graphqlPlugin
    }
  }
]

Usage

Basic

Advanced

Last updated on