forked from neo4j/graphql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
95 lines (94 loc) · 3.58 KB
/
.eslintrc.js
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
88
89
90
91
92
93
94
95
const commaDangle = {
arrays: "always-multiline",
objects: "always-multiline",
imports: "always-multiline",
exports: "always-multiline",
functions: "never",
};
module.exports = {
extends: ["eslint:recommended", "plugin:eslint-comments/recommended", "plugin:import/recommended", "prettier"],
root: true,
env: {
node: true,
es2021: true,
},
rules: {
"comma-dangle": ["error", commaDangle],
"eslint-comments/no-unused-disable": "error",
// Expensive rules disabled below
"import/default": "off",
"import/namespace": "off",
"import/no-named-as-default": "off",
"import/no-named-as-default-member": "off",
},
overrides: [
{
files: ["**/*.ts", "**/*.tsx"],
extends: [
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:import/typescript",
],
parser: "@typescript-eslint/parser",
parserOptions: {
tsconfigRootDir: __dirname,
project: "./**/tsconfig.json",
},
rules: {
"comma-dangle": "off",
"@typescript-eslint/comma-dangle": [
"error",
{
...commaDangle,
enums: "always-multiline",
generics: "always-multiline",
tuples: "never", // Removed due to conflict with prettier
},
],
"@typescript-eslint/ban-ts-comment": ["error", { "ts-ignore": "allow-with-description" }],
"@typescript-eslint/restrict-template-expressions": "off",
"@typescript-eslint/no-explicit-any": "off",
// The below are a project for when we pursue complete type safety
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/consistent-type-imports": [
"error",
{
prefer: "type-imports",
},
],
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
ignoreRestSiblings: true,
},
],
},
settings: {
"import/resolver": {
typescript: {
project: "./**/tsconfig.json",
},
},
},
},
{
files: ["jest.test-setup.js", "**/*.test.ts"],
extends: ["plugin:jest/recommended", "plugin:jest/style"],
rules: {
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-explicit-any": "off",
"jest/expect-expect": ["warn", { assertFunctionNames: ["expect", "expectTypeOf"] }],
},
},
],
};