-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.js
96 lines (92 loc) · 2.6 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
module.exports = {
env: {
browser: true,
es6: true,
node: true,
jest: true,
},
parser: "@typescript-eslint/parser",
extends: [
"plugin:@typescript-eslint/recommended",
"eslint:recommended",
"prettier",
],
parserOptions: {
ecmaVersion: "esnext",
ecmaFeatures: {
experimentalObjectRestSpread: true,
jsx: true,
},
},
plugins: ["babel", "prettier"],
ignorePatterns: ["node_modules", "dist", "@types/modules.d.ts"],
overrides: [
{
files: ["bin/*"],
rules: {
"@typescript-eslint/no-var-requires": 0,
"@typescript-eslint/explicit-function-return-type": 0,
},
},
],
rules: {
// Plugin rules:
"prettier/prettier": "error",
// overriding recommended rules
"no-constant-condition": ["error", { checkLoops: false }],
"no-console": ["error", { allow: ["log", "warn", "error"] }],
"@typescript-eslint/no-use-before-define": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-empty-function": 0,
"@typescript-eslint/no-non-null-assertion": 0,
"no-inner-declarations": 0,
"@typescript-eslint/no-empty-interface": 0,
"no-redeclare": 0,
// Use typescript's
"no-unused-vars": 0,
"no-undef": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
},
],
"@typescript-eslint/explicit-function-return-type": 0,
// possible errors
"array-callback-return": "error",
"consistent-return": "error",
"default-case": "error",
"dot-notation": "error",
eqeqeq: "error",
"for-direction": "error",
"no-alert": "error",
"no-caller": "error",
"no-eval": "error",
"no-extend-native": "error",
"no-extra-bind": "error",
"no-extra-label": "error",
"no-implied-eval": "error",
// We use the version from the babel plugin so that `this` in a function
// class property doesn't give a false positive.
"babel/no-invalid-this": "error",
"no-return-await": "error",
"no-self-compare": "error",
"no-throw-literal": "error",
"no-unmodified-loop-condition": "error",
"no-useless-call": "error",
"no-useless-computed-key": "error",
"no-useless-concat": "error",
"no-useless-constructor": "error",
"no-useless-rename": "error",
"no-useless-return": "error",
"no-var": "error",
"no-void": "error",
"no-with": "error",
"prefer-const": "error",
"prefer-promise-reject-errors": "error",
"prefer-rest-params": "error",
"prefer-spread": "error",
"no-else-return": "error",
},
};