-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.eslintrc.js
87 lines (87 loc) · 2.37 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
/** @type {import("eslint").Linter.Config} */
module.exports = {
root: true,
extends: ["eslint:recommended", "prettier"],
plugins: ["simple-import-sort"],
rules: {
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "warn",
},
parserOptions: {
ecmaVersion: "latest",
},
env: {
es6: true,
node: true,
},
overrides: [
{
files: ["*.mjs"],
parserOptions: {
sourceType: "module",
ecmaVersion: 2020,
},
},
{
files: ["*.ts", "*.tsx"],
plugins: ["@typescript-eslint/eslint-plugin", "simple-import-sort"],
parser: "@typescript-eslint/parser",
settings: {
"import/resolver": {
typescript: {
alwaysTryTypes: true,
},
},
},
parserOptions: {
tsconfigRootDir: process.cwd(),
project: "./tsconfig.json",
},
extends: [
"plugin:@typescript-eslint/strict-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked",
],
rules: {
"no-redeclare": "off", // replace with @typescript-eslint version
"no-unused-vars": "off", // replace with @typescript-eslint version
"@typescript-eslint/no-extra-semi": "off", // no need with prettier
"@typescript-eslint/no-redeclare": "error",
"@typescript-eslint/dot-notation": "off", // conflict with `noPropertyAccessFromIndexSignature`
"@typescript-eslint/switch-exhaustiveness-check": "error",
"@typescript-eslint/restrict-template-expressions": [
"error",
{ allowNumber: true },
],
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
},
],
"@typescript-eslint/consistent-type-imports": [
"error",
{
prefer: "type-imports",
},
],
"@typescript-eslint/prefer-nullish-coalescing": [
"error",
{
ignorePrimitives: {
boolean: true,
},
},
],
"@typescript-eslint/no-confusing-void-expression": [
"error",
{
ignoreArrowShorthand: true,
},
],
},
},
],
ignorePatterns: ["node_modules/", "dist/", "out/"],
}