-
Notifications
You must be signed in to change notification settings - Fork 3
/
.eslintrc.cjs
107 lines (107 loc) · 2.85 KB
/
.eslintrc.cjs
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
96
97
98
99
100
101
102
103
104
105
106
107
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint", "import", "jest"],
extends: ["eslint:recommended", "plugin:import/typescript"],
rules: {
"import/first": "error",
"import/named": "error",
"import/no-absolute-path": "error",
"import/no-mutable-exports": "error",
"import/no-self-import": "error",
"import/no-unused-modules": "error",
"import/no-useless-path-segments": "error",
"import/no-default-export": "warn",
"import/order": [
"error",
{
alphabetize: {
order: "asc",
caseInsensitive: true,
},
groups: [
"builtin",
"external",
"internal",
"parent",
"sibling",
"index",
],
"newlines-between": "always",
pathGroups: [
{
pattern: "@/**",
group: "internal",
},
],
},
],
"no-extra-semi": "off",
"no-undef": "off",
"no-unused-vars": "off",
"no-fallthrough": "off",
},
overrides: [
{
// enable the rule specifically for TypeScript files
files: ["*.ts", "*.tsx"],
extends: [
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
],
rules: {
"@typescript-eslint/explicit-function-return-type": [
"warn",
{
allowExpressions: true,
},
],
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-empty-interface": [
"error",
{
allowSingleExtends: true,
},
],
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-use-before-define": [
"error",
{ functions: false },
],
"prefer-spread": "off",
},
},
{
files: ["*.d.ts"],
extends: [
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
],
rules: {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/triple-slash-reference": "off",
},
},
{
files: ["**/__test__/**/*.ts", "*.test.ts", "*.test.tsx"],
extends: ["plugin:jest/recommended"],
rules: {
"no-empty": "warn",
"@typescript-eslint/ban-ts-comment": "warn",
"@typescript-eslint/no-unsafe-declaration-merging": "off",
"@typescript-eslint/explicit-function-return-type": "off",
},
},
{
files: ["examples/**/*.ts"],
extends: ["plugin:jest/recommended"],
rules: {
"@typescript-eslint/explicit-function-return-type": "off",
},
},
],
}