-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
52 lines (50 loc) · 1.99 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
module.exports = {
root: true,
env: {
node: true,
},
plugins: ['react-hooks'],
extends: ['plugin:@typescript-eslint/recommended'],
rules: {
'arrow-parens': ['warn', 'as-needed'],
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
/////
'no-console': 0, // console.log ok
'no-empty': 0, // catch(e) {}
// 'no-unused-vars': ['warn', {argsIgnorePattern: '_$'}],
'no-extra-semi': 0, // starting a line ok
'no-octal': 0, // for file modes
// 'require-atomic-updates': 0, // see https://github.com/eslint/eslint/issues/11899
'no-var': 'warn', // prefer const and let
'no-shadow': 'warn', // local variable names must not "mask" identical names from the containing scope
'guard-for-in': 'warn', // Did you mean: `for of`?
'require-await': 'warn', // warn about 'async' functions not having an 'await' inside
eqeqeq: ['warn', 'smart'], // ===
/// typescript:
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/member-delimiter-style': [
1,
{
multiline: {
delimiter: 'none',
requireLast: false,
},
singleline: {
delimiter: 'semi',
requireLast: false,
},
},
],
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/class-name-casing': 0, // interface name `savePageRet` is ok
'@typescript-eslint/no-empty-interface': 0,
'@typescript-eslint/no-var-requires': 0, // for now, `const foo = require(...)` is ok
'@typescript-eslint/no-unused-vars': ['warn', {argsIgnorePattern: '_$'}],
'@typescript-eslint/no-inferrable-types': 0, // `_initialized: boolean = false` is ok
'@typescript-eslint/camelcase': 0, // `firstImage_c` is ok
'@typescript-eslint/no-empty-function': 0, // `() => {}` is ok
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn', // <--- THIS IS THE NEW RULE
},
}