-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
58 lines (56 loc) · 1.7 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
53
54
55
56
57
58
// @ts-check
import * as graphql from "@graphql-eslint/eslint-plugin"
import { loadConfigSync } from "graphql-config"
import withNuxt from "./.nuxt/eslint.config.mjs"
export default withNuxt(
{
rules: {
"no-console": "warn",
"vue/max-attributes-per-line": [
"error",
{
singleline: { max: 3 },
multiline: { max: 1 },
},
],
"@typescript-eslint/no-explicit-any": "warn",
},
}
)
// We had the same issue before prepending.
// https://github.com/dimaMachina/graphql-eslint/issues/480
// https://github.com/dimaMachina/graphql-eslint/blob/v4-1/examples/vue-code-file/eslint.config.js
//
// Stolen from https://github.com/dimaMachina/graphql-eslint/blob/c9cbf6d8065740302cfb75b278733701dd5f7cf6/examples/vue-code-file/eslint.config.js
.prepend({
name: "graphql-in-vue",
files: ["**/*.vue", "**/*.ts", "**/*.tsx"],
processor: graphql.processors.graphql,
},
{
name: "graphql",
files: ["**/*.graphql"],
languageOptions: {
parser: graphql.parser,
parserOptions: { graphQLConfig: loadConfigSync({ filepath: ".graphqlrc.yml", rootDir: "." }) },
},
plugins: {
"@graphql-eslint": {
rules: /** @type {Record<string, import('eslint').Rule.RuleModule>} */ (graphql.rules)
},
},
rules: {
...graphql.configs["flat/operations-recommended"],
"@graphql-eslint/executable-definitions": "off",
"@graphql-eslint/no-anonymous-operations": "error",
"@graphql-eslint/no-duplicate-fields": "error",
"@graphql-eslint/naming-convention": [
"error",
{
OperationDefinition: {
style: "PascalCase",
},
},
],
},
})