Skip to content

Commit 0d7a54d

Browse files
committed
feat!: update dependencies and support ESLint 9
1 parent aa1b02b commit 0d7a54d

File tree

5 files changed

+29
-23
lines changed

5 files changed

+29
-23
lines changed

README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@ export default [
4141
files: ['**/*.{gql,graphql}'],
4242
languageOptions: {
4343
parserOptions: {
44-
schema: 'path/to/your/schema/**/*.{gql,graphql}',
45-
operations: 'path/to/your/operations/**/*.{gql,graphql}',
44+
graphQLConfig: {
45+
schema: 'path/to/your/schema/**/*.{gql,graphql}',
46+
documents: 'path/to/your/operations/**/*.{gql,graphql}',
47+
},
4648
},
4749
},
4850
},

eslint.config.js

+15-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,18 @@ import cheminfo from 'eslint-config-cheminfo';
22

33
import graphql from './index.js';
44

5-
export default [...cheminfo, ...graphql];
5+
export default [
6+
...cheminfo,
7+
...graphql,
8+
{
9+
files: ['**/*.{gql,graphql}'],
10+
languageOptions: {
11+
parserOptions: {
12+
graphQLConfig: {
13+
schema: './test/schema/**/*.{gql,graphql}',
14+
documents: './test/operations/**/*.{gql,graphql}',
15+
},
16+
},
17+
},
18+
},
19+
];

index.js

+2-11
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,7 @@ export default [
77
'@graphql-eslint': graphqlEslint,
88
},
99
languageOptions: {
10-
parser: {
11-
...graphqlEslint,
12-
// Necessary to avoid an error when ESLint is run with --cache.
13-
// https://github.com/dimaMachina/graphql-eslint/issues/2178
14-
// TODO: remove this when fixed in the package.
15-
meta: {
16-
name: '@graphql-eslint',
17-
},
18-
},
10+
parser: graphqlEslint.parser,
1911
},
2012
rules: {
2113
'@graphql-eslint/alphabetize': 'off',
@@ -56,7 +48,6 @@ export default [
5648
],
5749

5850
'@graphql-eslint/no-anonymous-operations': 'error',
59-
'@graphql-eslint/no-case-insensitive-enum-values-duplicates': 'error',
6051
'@graphql-eslint/no-deprecated': 'warn',
6152
'@graphql-eslint/no-duplicate-fields': 'error',
6253
'@graphql-eslint/no-hashtag-description': 'error',
@@ -85,7 +76,7 @@ export default [
8576
'@graphql-eslint/require-deprecation-reason': 'error',
8677
'@graphql-eslint/require-description': 'off',
8778
'@graphql-eslint/require-field-of-type-query-in-mutation-result': 'off',
88-
'@graphql-eslint/require-id-when-available': 'error',
79+
'@graphql-eslint/require-selections': 'error',
8980

9081
'@graphql-eslint/scalar-leafs': 'error',
9182
'@graphql-eslint/selection-set-depth': 'off',

package.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@
1717
"test-only": "node test/test.js"
1818
},
1919
"dependencies": {
20-
"@graphql-eslint/eslint-plugin": "^3.20.1"
20+
"@graphql-eslint/eslint-plugin": "4.0.0-alpha.4"
2121
},
2222
"peerDependencies": {
23-
"eslint": "^8.57.0",
24-
"graphql": "^16.8.1"
23+
"eslint": "^8.57.0 || ^9.12.0",
24+
"graphql": "^16.9.0"
2525
},
2626
"devDependencies": {
27-
"eslint": "8.57.0",
28-
"eslint-config-cheminfo": "^11.0.3",
29-
"graphql": "16.8.1",
30-
"prettier": "^3.3.2"
27+
"eslint": "9.12.0",
28+
"eslint-config-cheminfo": "^12.0.0",
29+
"graphql": "16.9.0",
30+
"prettier": "^3.3.3"
3131
}
3232
}

test/test.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import assert from 'node:assert';
22

3-
import { loadESLint } from 'eslint';
3+
import { ESLint } from 'eslint';
44

5-
const ESLint = await loadESLint({ useFlatConfig: true });
65
const eslint = new ESLint();
76
const formatter = await eslint.loadFormatter('stylish');
87

0 commit comments

Comments
 (0)