Skip to content

Commit 9096458

Browse files
authored
add meta object with name and version to parser and processor to be compatible with ESLint 9 (#2458)
* fix lint * aa * aa * more * more * more * more * more * more * format * fix examples test * fix website * fix * aa * try * okk * nowww
1 parent 016b6d5 commit 9096458

File tree

29 files changed

+89
-62
lines changed

29 files changed

+89
-62
lines changed

.changeset/lovely-laws-hide.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@graphql-eslint/eslint-plugin': patch
3+
---
4+
5+
add `meta` object with `name` and `version` to `parser` and `processor` to be compatible with ESLint
6+
9

examples/code-file/eslint.config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import js from '@eslint/js';
2-
import * as graphqlESLint from '@graphql-eslint/eslint-plugin';
2+
import * as graphql from '@graphql-eslint/eslint-plugin';
33

44
export default [
55
{
66
files: ['**/*.js'],
7-
processor: graphqlESLint.processors.graphql,
7+
processor: graphql.processors.graphql,
88
rules: {
99
...js.configs.recommended.rules,
1010
'no-console': 'error',
@@ -13,10 +13,10 @@ export default [
1313
{
1414
files: ['**/*.graphql'],
1515
plugins: {
16-
'@graphql-eslint': graphqlESLint,
16+
'@graphql-eslint': { rules: graphql.rules },
1717
},
1818
languageOptions: {
19-
parser: graphqlESLint,
19+
parser: graphql.parser,
2020
},
2121
rules: {
2222
'@graphql-eslint/no-anonymous-operations': 'error',

examples/code-file/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"author": "Dotan Simha <[email protected]>",
77
"private": true,
88
"scripts": {
9-
"lint": "eslint ."
9+
"lint": "eslint --cache ."
1010
},
1111
"dependencies": {
1212
"graphql": "16.9.0"

examples/graphql-config/eslint.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import js from '@eslint/js';
2-
import * as graphqlESLint from '@graphql-eslint/eslint-plugin';
2+
import * as graphql from '@graphql-eslint/eslint-plugin';
33

44
export default [
55
{
@@ -9,10 +9,10 @@ export default [
99
{
1010
files: ['**/*.graphql'],
1111
plugins: {
12-
'@graphql-eslint': graphqlESLint,
12+
'@graphql-eslint': { rules: graphql.rules },
1313
},
1414
languageOptions: {
15-
parser: graphqlESLint,
15+
parser: graphql.parser,
1616
},
1717
rules: {
1818
'@graphql-eslint/no-anonymous-operations': 'error',

examples/graphql-config/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"author": "Dotan Simha <[email protected]>",
77
"private": true,
88
"scripts": {
9-
"lint": "eslint ."
9+
"lint": "eslint --cache ."
1010
},
1111
"dependencies": {
1212
"graphql": "16.9.0"

examples/monorepo/eslint.config.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import js from '@eslint/js';
2-
import * as graphqlESLint from '@graphql-eslint/eslint-plugin';
2+
import * as graphql from '@graphql-eslint/eslint-plugin';
33

44
const SCHEMA_PATH = 'server/**/*.gql';
55

@@ -11,7 +11,7 @@ export default [
1111
{
1212
files: ['client/**/*.tsx'],
1313
// Setup processor for operations/fragments definitions on code-files
14-
processor: graphqlESLint.processors.graphql,
14+
processor: graphql.processors.graphql,
1515
languageOptions: {
1616
parserOptions: {
1717
sourceType: 'module',
@@ -25,20 +25,20 @@ export default [
2525
// Setup GraphQL Parser
2626
files: ['**/*.{graphql,gql}'],
2727
plugins: {
28-
'@graphql-eslint': graphqlESLint,
28+
'@graphql-eslint': { rules: graphql.rules },
2929
},
3030
languageOptions: {
31-
parser: graphqlESLint,
31+
parser: graphql.parser,
3232
},
3333
},
3434
{
3535
// Setup recommended config for schema files
3636
files: [SCHEMA_PATH],
37-
...graphqlESLint.flatConfigs['schema-recommended'],
37+
...graphql.flatConfigs['schema-recommended'],
3838
},
3939
{
4040
// Setup recommended config for operations files
4141
files: ['client/**/*.{graphql,gql}'],
42-
...graphqlESLint.flatConfigs['operations-recommended'],
42+
...graphql.flatConfigs['operations-recommended'],
4343
},
4444
];

examples/monorepo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"author": "Dimitri POSTOLOV",
66
"private": true,
77
"scripts": {
8-
"lint": "eslint ."
8+
"lint": "eslint --cache ."
99
},
1010
"dependencies": {
1111
"graphql": "16.9.0"

examples/multiple-projects-graphql-config/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"author": "Dimitri POSTOLOV",
55
"private": true,
66
"scripts": {
7-
"lint": "ESLINT_USE_FLAT_CONFIG=false eslint ."
7+
"lint": "ESLINT_USE_FLAT_CONFIG=false eslint --cache ."
88
},
99
"dependencies": {
1010
"graphql": "16.9.0"

examples/prettier/eslint.config.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import prettierConfig from 'eslint-config-prettier';
22
import prettierPlugin from 'eslint-plugin-prettier';
33
import js from '@eslint/js';
4-
import * as graphqlESLint from '@graphql-eslint/eslint-plugin';
4+
import * as graphql from '@graphql-eslint/eslint-plugin';
55

66
export default [
77
{
88
plugins: {
9-
prettier: prettierPlugin,
9+
prettier: { rules: prettierPlugin.rules },
1010
},
1111
},
1212
{
1313
files: ['**/*.js'],
14-
processor: graphqlESLint.processors.graphql,
14+
processor: graphql.processors.graphql,
1515
rules: {
1616
...js.configs.recommended.rules,
1717
...prettierConfig.rules,
@@ -21,10 +21,10 @@ export default [
2121
{
2222
files: ['**/*.graphql'],
2323
languageOptions: {
24-
parser: graphqlESLint,
24+
parser: graphql.parser,
2525
},
2626
plugins: {
27-
'@graphql-eslint': graphqlESLint,
27+
'@graphql-eslint': { rules: graphql.rules },
2828
},
2929
rules: {
3030
'prettier/prettier': 'error',

examples/prettier/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"author": "JounQin <[email protected]>",
77
"private": true,
88
"scripts": {
9-
"lint": "eslint ."
9+
"lint": "eslint --cache ."
1010
},
1111
"dependencies": {
1212
"graphql": "16.9.0"

0 commit comments

Comments
 (0)