This repository has been archived by the owner on Sep 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
.eslintrc.js
93 lines (88 loc) · 2.44 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
module.exports = {
"extends": ["react-app"],
"env": {
"es6": true,
"browser": true
},
"plugins": [
"react",
"react-hooks",
"import",
],
// "parser": "babel-eslint",
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module",
"allowImportExportEverywhere": true,
"ecmaFeatures": {
"jsx": true,
"modules": true,
},
},
"settings": {
"import/resolver": {
"babel-module": {
"root": ['.'],
"extensions": ['.js', '.jsx', '.ts', '.tsx'],
"alias": {
"#actions": "./src/root/actions",
"#components": "./src/root/components",
"#config": "./src/root/config",
"#hooks": "./src/root/hooks",
"#types": "./src/root/types",
"#lang": "./src/root/lang",
"#selectors": "./src/root/selectors",
"#utils": "./src/root/utils",
"#views": "./src/root/views",
"#root": "./src/root",
}
},
},
"react": {
"version": "detect"
}
},
"rules": {
// NOTE: We must disable the base rule as it can report incorrect errors
"no-use-before-define": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-unused-vars": "warn",
"semi": [2, "always"],
"no-extra-semi": 2,
"semi-spacing": [2, { "before": false, "after": true }],
"react/display-name": 1 ,
"react/jsx-no-duplicate-props": 2,
"react/jsx-no-undef": 2,
"react/jsx-uses-react": 2,
"react/jsx-uses-vars": 2,
"react/no-danger": 0,
"react/no-deprecated": 1,
"react/no-did-mount-set-state": 2,
"react/no-did-update-set-state": 2,
"react/no-direct-mutation-state": 2,
"react/no-is-mounted": 2,
"react/no-unknown-property": 2,
// "react/prop-types": 1,
"react/react-in-jsx-scope": 2,
"prefer-promise-reject-errors": 0,
"comma-dangle": 0,
// NOTE: following is temporarily disabled due to too many warnings
// and should be fixed eventually
"default-case": 0,
"jsx-a11y/alt-text": 0,
"jsx-a11y/anchor-is-valid": 0,
"jsx-a11y/iframe-has-title": 0,
"jsx-a11y/anchor-has-content": 0,
"react/jsx-no-target-blank": 0,
"react/prop-types": 0,
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': [
'warn',
{
'additionalHooks': 'useDidUpdateEffect',
},
],
},
};