-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy patheslint.config.mjs
52 lines (49 loc) · 1.25 KB
/
eslint.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/**
* Copyright (c) 2024-present, NDLA.
*
* This source code is licensed under the GPLv3 license found in the
* LICENSE file in the root directory of this source tree.
*
*/
// @ts-check
import config from "eslint-config-ndla";
import tseslint from "typescript-eslint";
import graphqlPlugin from "@graphql-eslint/eslint-plugin";
export default tseslint.config(
...config,
{
ignores: ["**/graphqlTypes.ts", "**/schema.graphql"],
},
{
files: ["**/*.graphql"],
rules: {
"header/header": "off",
},
},
{
files: ["**/*.{js,mjs,cjs,ts,jsx,tsx,mts,cts,mtsx,ctsx}"],
processor: graphqlPlugin.processor,
},
{
files: ["**/*.graphql"],
languageOptions: {
parser: graphqlPlugin.parser,
parserOptions: {
graphQLConfig: {
schema: "./src/schema.graphql",
documents: ["./src/**/*.{ts,tsx}"],
},
},
},
plugins: {
"@graphql-eslint": graphqlPlugin,
},
rules: {
...graphqlPlugin.configs["flat/operations-recommended"].rules,
...graphqlPlugin.configs["flat/schema-recommended"].rules,
// TODO: Consider enabling these later
"@graphql-eslint/selection-set-depth": "off",
"@graphql-eslint/require-selections": "off",
},
},
);