This repository has been archived by the owner on Jan 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.json
87 lines (79 loc) · 2.66 KB
/
.eslintrc.json
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
{
// Choose default parser.
"parser": "@typescript-eslint/parser",
// Parser options.
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module"
},
// Add plugins.
"extends": [
// Prevent double linting from ts and eslint.
"plugin:@typescript-eslint/recommended",
// Prevent double linting from ts and prettier.
"prettier/@typescript-eslint",
// Add rules for test files, it forbids you from writing tests
// without describe part, it doesn't allow you to write tests that doesn't
// have assertions, and many more.
"plugin:jest/all",
// Prevent from writing promises with no resolve.
"plugin:promise/recommended",
// Add recommended prettier rules.
"plugin:prettier/recommended"
],
// Add rules if needed, I am happy as it is.
"rules": {},
// Add config for GraphQL files.
"overrides": [
{
"files": ["*.graphql"],
"parser": "@graphql-eslint/eslint-plugin",
"plugins": ["@graphql-eslint"],
"rules": {
"@graphql-eslint/require-description": [
"error",
{
"on": [
"SchemaDefinition",
"ObjectTypeDefinition",
"FieldDefinition",
"InputValueDefinition",
"InterfaceTypeDefinition",
"UnionTypeDefinition",
"EnumTypeDefinition",
"EnumValueDefinition",
"InputObjectTypeDefinition",
"DirectiveDefinition"
]
}
],
"@graphql-eslint/prettier": ["error"],
"@graphql-eslint/require-id-when-available": ["error"],
"@graphql-eslint/no-operation-name-suffix": ["error"],
"@graphql-eslint/no-case-insensitive-enum-values-duplicates": ["error"],
"@graphql-eslint/require-deprecation-reason": ["error"],
"@graphql-eslint/no-anonymous-operations": ["error"],
"@graphql-eslint/naming-convention": [
"error",
{
"ObjectTypeDefinition": "PascalCase",
"FieldDefinition": "camelCase",
"EnumValueDefinition": "UPPER_CASE",
"InputValueDefinition": "camelCase",
"FragmentDefinition": "PascalCase",
"ScalarTypeDefinition": "PascalCase",
"leadingUnderscore": "forbid",
"trailingUnderscore": "forbid"
}
],
"@graphql-eslint/description-style": ["error", { "style": "inline" }],
"@graphql-eslint/input-name": ["error", { "checkInputType": false }],
"@graphql-eslint/avoid-operation-name-prefix": [
"error",
{ "keywords": ["get"] }
],
"prettier/prettier": "off"
}
}
]
}