-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.js
114 lines (106 loc) · 3 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
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 2019,
sourceType: "module",
},
plugins: [
"@typescript-eslint",
"import",
"react",
"react-hooks",
"react-native",
],
settings: {
react: {
version: "16.8.6",
},
},
extends: ["eslint:recommended", "plugin:react/recommended"],
env: {
es6: true,
node: true,
browser: true,
jest: true,
},
globals: {
__DEV__: true,
__TEST__: true,
},
rules: {
"no-empty": "warn",
"no-empty-pattern": "off",
"no-unused-vars": "warn",
"no-console": "warn",
"no-async-promise-executor": "warn",
"no-misleading-character-class": "warn",
"no-template-curly-in-string": "warn",
"require-atomic-updates": "warn",
"block-scoped-var": "error",
"consistent-return": "warn",
eqeqeq: ["warn", "always", {null: "ignore"}],
"no-alert": "warn",
"no-caller": "warn",
"no-eval": "warn",
"no-extend-native": "warn",
"no-extra-label": "warn",
"no-implied-eval": "warn",
"no-multi-str": "warn",
"no-new-func": "warn",
"no-octal-escape": "warn",
"no-self-compare": "warn",
"no-unused-expressions": "warn",
"no-with": "error",
radix: "warn",
"wrap-iife": "warn",
yoda: "warn",
"no-label-var": "error",
"no-shadow-restricted-names": "error",
"no-buffer-constructor": "warn",
"no-path-concat": "warn",
"prefer-arrow-callback": "warn",
"no-inner-declarations": "off",
"func-style": ["warn", "declaration"],
"no-var": "warn",
"prefer-const": ["warn", {destructuring: "all"}],
"sort-imports": "warn",
"no-constant-condition": "warn",
"@typescript-eslint/adjacent-overload-signatures": "warn",
"@typescript-eslint/array-type": ["warn", "generic"],
"@typescript-eslint/no-angle-bracket-type-assertion": "warn",
"@typescript-eslint/no-triple-slash-reference": "warn",
"@typescript-eslint/prefer-function-type": "warn",
// NOTE: Use the TypeScript camelcase rule instead of the base ESLint one.
camelcase: "off",
"@typescript-eslint/camelcase": [
"warn",
{
properties: "never",
allow: ["^UNSAFE_", "^unstable_", "^test_", "^ignorePrivacy_"],
},
],
"import/first": "warn",
"import/newline-after-import": "warn",
"import/no-extraneous-dependencies": "error",
"react/jsx-key": "warn",
"react/prop-types": "off",
"react/display-name": "off",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"react-native/no-unused-styles": "warn",
},
overrides: [
{
files: ["*.ts", "*.tsx"],
rules: {
// NOTE: TypeScript will warn about this. TypeScript also does it better
// since it can understand reads/writes.
"no-undef": "off",
"no-unused-vars": "off",
"consistent-return": "off",
"no-dupe-class-members": "off", // TypeScript allows overloaded class methods.
},
},
],
};