-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.eslintrc.js
84 lines (81 loc) · 2.82 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
const isProduction = process.env.NODE_ENV === 'production'
module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
// 'prettier/@typescript-eslint',
],
plugins: ['@typescript-eslint', 'prettier', 'import'],
parserOptions: {
project: './tsconfig.json',
ecmaVersion: 2018,
sourceType: 'module',
warnOnUnsupportedTypeScriptVersion: false,
},
env: { browser: true },
ignorePatterns: ['.eslintrc.js'],
rules: {
'prettier/prettier': 'error',
// '@typescript-eslint/no-floating-promises': 'error',
'require-await': 'error',
'comma-spacing': ['error', { before: false, after: true }],
'import/no-namespace': 'off',
// 'import/no-default-export': 'error',
'no-invalid-this': 'error',
// 'no-autofix/no-unreachable': 'error',
'space-in-parens': 'error',
'no-empty-function': 'off',
// temporary fix to allow Function
'@typescript-eslint/ban-types': ['off'],
'@typescript-eslint/no-empty-function': ['off'],
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'space-before-function-paren': 'off',
'eol-last': 'off',
'operator-linebreak': 'off',
'no-useless-escape': 'off',
'no-var': 'error',
'no-console': isProduction ? 'error' : 'warn',
'no-func-assign': 'error',
'no-const-assign': 'error',
'no-class-assign': 'error',
'no-param-reassign': 'error',
'object-curly-spacing': ['error', 'always'],
'array-bracket-spacing': ['error', 'never'],
'linebreak-style': ['error', 'unix'],
'no-trailing-spaces': 'error',
'import/no-duplicates': 'error',
'import/named': 'error',
'import/default': 'error',
'import/order': [
'error',
{
groups: [
['builtin', 'external', 'internal', 'unknown'],
['parent', 'sibling', 'index'],
],
alphabetize: { order: 'asc', caseInsensitive: true },
'newlines-between': 'always',
},
],
camelcase: ['error', { properties: 'never' }],
// enforced functional rules
'prefer-const': 'error',
// 'functional/prefer-type-literal': 'error',
// 'functional/no-loop-statement': 'error',
// 'functional/no-let': 'error',
// // not enforced functional rules
// 'functional/immutable-data': 'off',
// 'functional/no-try-statement': 'off',
// 'functional/no-throw-statement': 'off',
// 'functional/no-expression-statement': 'off',
// 'functional/prefer-readonly-type': 'off',
// 'functional/functional-parameters': 'off',
// '@typescript-eslint/explicit-function-return-type': 'off',
// 'functional/no-conditional-statement': 'off',
// 'functional/no-mixed-type': 'off',
},
}