-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslint.rc.js
54 lines (54 loc) · 1.94 KB
/
.eslint.rc.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
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
},
root: true,
env: { node: true, browser: true, serviceworker: true },
plugins: ['@typescript-eslint', 'prettier'],
extends: ['plugin:@typescript-eslint/eslint-recommended', 'prettier/@typescript-eslint'],
ignorePatterns: ['dist/', 'node_modules/'],
rules: {
// 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
// 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'array-callback-return': 'error',
complexity: ['error', { max: 5 }],
'max-lines-per-function': ['error', { max: 33 }],
'max-nested-callbacks': ['error', 3],
'max-depth': ['error', 4],
'max-statements': ['error', 10, { ignoreTopLevelFunctions: true }],
'consistent-return': 'error',
eqeqeq: ['error', 'always'],
'no-implicit-coercion': 'error',
'no-invalid-this': 'error',
'no-new-wrappers': 'error',
'no-return-assign': 'error',
'no-return-await': 'error',
'no-sequences': 'error',
'no-throw-literal': 'error',
'no-unused-expressions': 'error',
'no-useless-catch': 'error',
'no-useless-escape': 'error',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
ignoreRestSiblings: true,
caughtErrors: 'none',
},
],
'no-useless-return': 'error',
'prefer-promise-reject-errors': 'error',
'require-await': 'error',
yoda: 'error',
camelcase: 'error',
'no-mixed-operators': 'error',
'prefer-const': 'error',
'prefer-template': 'error',
'template-curly-spacing': ['error', 'never'],
'func-names': ['error', 'always'],
'padding-line-between-statements': ['error', { blankLine: 'always', prev: '*', next: 'return' }],
'arrow-parens': [2, 'as-needed'],
},
};