https://github.com/zakodium/eslint-config-graphql
Eslint config for graphql files
https://github.com/zakodium/eslint-config-graphql
Last synced: 5 months ago
JSON representation
Eslint config for graphql files
- Host: GitHub
- URL: https://github.com/zakodium/eslint-config-graphql
- Owner: zakodium
- License: mit
- Created: 2021-02-03T09:39:46.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-10-06T13:49:02.000Z (over 1 year ago)
- Last Synced: 2025-10-20T02:52:33.850Z (8 months ago)
- Language: JavaScript
- Size: 71.3 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# @zakodium/eslint-config-graphql
Shared ESLint config for frontend and backend projects using GraphQL
## Installation
```console
npm i -D @zakodium/eslint-config-graphql eslint
```
`graphql` is also a peer dependency and would usually be in the dependencies of your project
```console
npm i graphql
```
## Usage
Create a `eslint.config.mjs` with the following contents:
```js
import graphql from '@zakodium/eslint-config-graphql';
export default [
// You will probably extend other configs as well.
...graphql,
];
```
Create a `.graphqlrc` or `.graphqlconfig` file with your GraphQL configuration
Or alternatively, specify the options in the ESLint config:
```js
import graphql from '@zakodium/eslint-config-graphql';
export default [
// You will probably extend other configs as well.
...graphql,
{
files: ['**/*.{gql,graphql}'],
languageOptions: {
parserOptions: {
graphQLConfig: {
schema: 'path/to/your/schema/**/*.{gql,graphql}',
documents: 'path/to/your/operations/**/*.{gql,graphql}',
},
},
},
},
];
```
You can then customize the config for your project by changing rules in this file.