Skip to content

Commit 32ca7e7

Browse files
committed
Eslint graphql
1 parent bc81c09 commit 32ca7e7

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ __debug_bin*
1212
node_modules
1313
package-lock.json
1414
hack/coverprofile.txt
15+
.eslintcache

Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ prettier:
7676
helm-lint:
7777
helm lint --strict ./charts
7878

79+
graphql-lint:
80+
npx eslint --cache
81+
7982
setup-local:
8083
GOOGLE_MANAGEMENT_PROJECT_ID=nais-local-dev go run ./cmd/setup_local -users 40 -teams 10 -owners 2 -members 4 -provision_pub_sub
8184

eslint.config.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
11
import pluginJs from "@eslint/js";
2-
import * as graphql from "@graphql-eslint/eslint-plugin";
2+
import graphql from "@graphql-eslint/eslint-plugin";
33

44
export default [
55
{
66
files: ["**/*.js"],
77
rules: pluginJs.configs.recommended.rules,
88
},
99
{
10-
files: ["internal/v1/**/*.graphqls"],
10+
files: ["internal/**/*.graphqls"],
1111
languageOptions: {
1212
parser: graphql.parser,
1313
parserOptions: {
1414
graphQLConfig: {
15-
schema: "./internal/v1/graphv1/schema/*.graphqls",
15+
schema: "./internal/graph/schema/*.graphqls",
1616
},
1717
},
1818
},
1919
plugins: {
20-
"@graphql-eslint": { rules: graphql.rules },
20+
"@graphql-eslint": graphql,
2121
},
2222
rules: {
23-
...graphql.configs["flat/schema-recommended"],
23+
...graphql.configs["flat/schema-recommended"].rules,
24+
"@graphql-eslint/description-style": ["off"],
25+
"@graphql-eslint/require-description": ["off"],
2426
"@graphql-eslint/strict-id-in-types": [
2527
"error",
2628
{

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"type": "module",
33
"devDependencies": {
4-
"@graphql-eslint/eslint-plugin": "^4.0.0-alpha.6",
5-
"eslint": "^9.13.0",
4+
"@graphql-eslint/eslint-plugin": "4.0.0-alpha.13",
5+
"eslint": "^9.15.0",
66
"prettier": "^3.3.3",
77
"prettier-plugin-sql-custom": "git+https://github.com/nais/prettier-plugin-sql.git"
88
}

0 commit comments

Comments
 (0)