-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.eslintrc.js
165 lines (164 loc) · 3.78 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
const rules = {
"max-len": [
"error",
{ code: 120, ignoreStrings: true, ignoreTemplateLiterals: true },
],
"no-underscore-dangle": ["error", { allow: ["_id"] }],
"import/prefer-default-export": "off",
"import/extensions": [
"error",
"ignorePackages",
{
js: "never",
ts: "never",
},
],
semi: ["error", "always"],
"no-plusplus": ["error", { allowForLoopAfterthoughts: true }],
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": "off",
"prefer-destructuring": [
"error",
{
AssignmentExpression: {
array: false,
object: false,
},
},
{
enforceForRenamedProperties: false,
},
],
curly: "error",
"import/no-extraneous-dependencies": [
"error",
{
devDependencies: [
"tests/**/*.spec.ts",
"tests/**/*.test.ts",
"test.ts",
"spec.ts",
"test-*.ts",
"jest.config.js",
"jest.setup.js",
"vue.config.js",
".eslintrc.js",
"tests/**/browser.js",
"tests/**/browser_iframe.js",
],
optionalDependencies: false,
},
],
"@typescript-eslint/naming-convention": [
"warn",
{
selector: "variable",
format: ["camelCase", "PascalCase", "UPPER_CASE"],
leadingUnderscore: "allow",
},
{
selector: "property",
format: ["camelCase", "PascalCase", "UPPER_CASE"],
leadingUnderscore: "allowSingleOrDouble",
},
{
selector: "function",
format: ["camelCase", "PascalCase"],
},
{
selector: "typeLike",
format: ["PascalCase"],
},
],
};
module.exports = {
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 2021,
sourceType: "module",
},
env: {
es2021: true,
browser: true,
node: true,
jest: true,
},
extends: [
"airbnb",
"airbnb/hooks",
"plugin:import/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"prettier",
],
globals: {
Atomics: "readonly",
SharedArrayBuffer: "readonly",
},
plugins: ["import", "jest", "prettier"],
rules,
settings: {
"import/resolver": {
node: {
extensions: [".ts", ".js", ".json"],
},
},
"import/extensions": [".ts", ".d.ts", ".js"],
"import/external-module-folders": ["node_modules", "node_modules/@types"],
},
overrides: [
{
files: ["*.ts"],
extends: [
"airbnb-typescript",
"airbnb/hooks",
"plugin:import/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"prettier",
"plugin:@typescript-eslint/recommended",
],
plugins: ["import", "prettier", "@typescript-eslint"],
parserOptions: {
project: "./tsconfig.json",
},
settings: {
"import/resolver": {
node: {
extensions: [".ts", ".json", ".d.ts", ".js"],
},
},
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".d.ts", ".js"],
},
},
rules: {
...rules,
"constructor-super": "off",
"getter-return": "off",
"no-const-assign": "off",
"no-dupe-args": "off",
"no-dupe-class-members": "off",
"no-dupe-keys": "off",
"no-func-assign": "off",
"no-new-symbol": "off",
"no-obj-calls": "off",
"no-redeclare": "off",
"no-this-before-super": "off",
"no-undef": "off",
"no-unreachable": "off",
"no-unsafe-negation": "off",
"valid-typeof": "off",
"import/named": "off",
"import/no-unresolved": "off",
},
},
{
files: ["tests/**/*.ts"],
parserOptions: {
project: "./tests/tsconfig.json",
},
},
],
};