-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
108 lines (108 loc) · 3.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
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
sourceType: 'module',
project: './tsconfig.json',
},
plugins: ['functional', 'fp-ts'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:functional/recommended',
'plugin:fp-ts/all',
'prettier',
'plugin:prettier/recommended',
],
reportUnusedDisableDirectives: true,
rules: {
'@typescript-eslint/array-type': ['warn', { default: 'array', readonly: 'generic' }],
'@typescript-eslint/consistent-type-definitions': 'off', // use functional/prefer-type-literal, it's better
'@typescript-eslint/explicit-function-return-type': [
'warn',
{
allowExpressions: true,
allowTypedFunctionExpressions: true,
allowHigherOrderFunctions: true,
},
],
'@typescript-eslint/no-base-to-string': 'error',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-unnecessary-condition': 'warn',
'@typescript-eslint/no-unused-vars': ['warn'],
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/strict-boolean-expressions': [
'warn',
{
allowString: false,
allowNumber: false,
allowNullableObject: false,
},
],
'arrow-parens': ['warn', 'as-needed'],
'arrow-body-style': ['warn', 'as-needed'],
'array-callback-return': 'off',
'comma-dangle': [
'warn',
{
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'always-multiline',
},
],
'fp-ts/no-module-imports': ['warn', { allowTypes: true }],
'functional/functional-parameters': [
'error',
{
allowRestParameter: true,
enforceParameterCount: false,
},
],
'functional/no-conditional-statement': 'off', // switch aren't bad :/
'functional/no-expression-statement': [
'error',
{ ignorePattern: ['^console\\.', '^describe\\(', '^it\\(', '^expect\\('] },
],
'functional/no-mixed-type': 'off',
'functional/no-promise-reject': 'error',
'max-len': [
'warn',
{
code: 100,
tabWidth: 2,
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignoreComments: true,
},
],
'no-console': 'off',
'no-empty-function': 'off',
'no-inner-declarations': 'off',
'no-multiple-empty-lines': ['warn', { max: 1 }],
'no-multi-spaces': 'warn',
'no-redeclare': 'off',
'no-shadow': ['error', { builtinGlobals: true, hoist: 'functions' }],
'no-undef': 'off',
'no-unneeded-ternary': 'warn',
'no-use-before-define': 'off',
'no-useless-computed-key': 'warn',
'no-useless-rename': 'warn',
'object-shorthand': 'warn',
'prettier/prettier': 'off',
quotes: ['warn', 'single', { avoidEscape: true, allowTemplateLiterals: true }],
'sort-imports': [
'warn',
{
ignoreCase: false,
ignoreDeclarationSort: true,
ignoreMemberSort: false,
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
allowSeparatedGroups: true,
},
],
'space-in-parens': ['warn', 'never'],
strict: 'warn',
},
}