Skip to content

Commit

Permalink
feat!: update dependencies and support ESLint 9
Browse files Browse the repository at this point in the history
  • Loading branch information
targos committed Oct 6, 2024
1 parent aa1b02b commit 0d7a54d
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 23 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ export default [
files: ['**/*.{gql,graphql}'],
languageOptions: {
parserOptions: {
schema: 'path/to/your/schema/**/*.{gql,graphql}',
operations: 'path/to/your/operations/**/*.{gql,graphql}',
graphQLConfig: {
schema: 'path/to/your/schema/**/*.{gql,graphql}',
documents: 'path/to/your/operations/**/*.{gql,graphql}',
},
},
},
},
Expand Down
16 changes: 15 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,18 @@ import cheminfo from 'eslint-config-cheminfo';

import graphql from './index.js';

export default [...cheminfo, ...graphql];
export default [
...cheminfo,
...graphql,
{
files: ['**/*.{gql,graphql}'],
languageOptions: {
parserOptions: {
graphQLConfig: {
schema: './test/schema/**/*.{gql,graphql}',
documents: './test/operations/**/*.{gql,graphql}',
},
},
},
},
];
13 changes: 2 additions & 11 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,7 @@ export default [
'@graphql-eslint': graphqlEslint,
},
languageOptions: {
parser: {
...graphqlEslint,
// Necessary to avoid an error when ESLint is run with --cache.
// https://github.com/dimaMachina/graphql-eslint/issues/2178
// TODO: remove this when fixed in the package.
meta: {
name: '@graphql-eslint',
},
},
parser: graphqlEslint.parser,
},
rules: {
'@graphql-eslint/alphabetize': 'off',
Expand Down Expand Up @@ -56,7 +48,6 @@ export default [
],

'@graphql-eslint/no-anonymous-operations': 'error',
'@graphql-eslint/no-case-insensitive-enum-values-duplicates': 'error',
'@graphql-eslint/no-deprecated': 'warn',
'@graphql-eslint/no-duplicate-fields': 'error',
'@graphql-eslint/no-hashtag-description': 'error',
Expand Down Expand Up @@ -85,7 +76,7 @@ export default [
'@graphql-eslint/require-deprecation-reason': 'error',
'@graphql-eslint/require-description': 'off',
'@graphql-eslint/require-field-of-type-query-in-mutation-result': 'off',
'@graphql-eslint/require-id-when-available': 'error',
'@graphql-eslint/require-selections': 'error',

'@graphql-eslint/scalar-leafs': 'error',
'@graphql-eslint/selection-set-depth': 'off',
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@
"test-only": "node test/test.js"
},
"dependencies": {
"@graphql-eslint/eslint-plugin": "^3.20.1"
"@graphql-eslint/eslint-plugin": "4.0.0-alpha.4"
},
"peerDependencies": {
"eslint": "^8.57.0",
"graphql": "^16.8.1"
"eslint": "^8.57.0 || ^9.12.0",
"graphql": "^16.9.0"
},
"devDependencies": {
"eslint": "8.57.0",
"eslint-config-cheminfo": "^11.0.3",
"graphql": "16.8.1",
"prettier": "^3.3.2"
"eslint": "9.12.0",
"eslint-config-cheminfo": "^12.0.0",
"graphql": "16.9.0",
"prettier": "^3.3.3"
}
}
3 changes: 1 addition & 2 deletions test/test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import assert from 'node:assert';

import { loadESLint } from 'eslint';
import { ESLint } from 'eslint';

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

Expand Down

0 comments on commit 0d7a54d

Please sign in to comment.