-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.cjs
132 lines (132 loc) · 4.33 KB
/
index.cjs
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
module.exports = {
extends: [
'eslint:all',
'plugin:@typescript-eslint/all',
'plugin:import/typescript',
'plugin:functional/external-typescript-recommended',
'plugin:functional/all',
'prettier',
],
plugins: ['import', 'eslint-comments', 'eslint-plugin-tsdoc', 'functional'],
rules: {
'@typescript-eslint/consistent-indexed-object-style': [
'error',
'index-signature',
],
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/max-params': 'error',
'@typescript-eslint/naming-convention': [
'error',
{
format: ['camelCase'],
leadingUnderscore: 'allow',
selector: 'default',
},
{
format: ['camelCase', 'UPPER_CASE'],
leadingUnderscore: 'allow',
selector: 'variable',
},
{ format: ['PascalCase'], selector: 'typeLike' },
{ selector: 'enumMember', format: ['camelCase', 'UPPER_CASE'] }, // Allow UPPER_CASE for opcodes
],
'@typescript-eslint/no-loss-of-precision': ['error'],
'@typescript-eslint/no-magic-numbers': [
'error',
{
ignore: [-1, 0, 1, '-1n', '0n', '1n'],
ignoreArrayIndexes: true,
ignoreEnums: true,
ignoreNumericLiteralTypes: true,
},
],
'@typescript-eslint/no-unused-vars': 'off', // already checked by TypeScript's noUnusedLocals and noUnusedParameters (this rule emits false positives on TSDoc `@link` usage)
'@typescript-eslint/prefer-literal-enum-member': [
'error',
{ allowBitwiseExpressions: true },
],
'@typescript-eslint/prefer-readonly-parameter-types': 'off',
'@typescript-eslint/restrict-template-expressions': [
'error',
{ allowNumber: true },
],
'@typescript-eslint/typedef': 'off',
'capitalized-comments': 'off',
complexity: ['error', 5],
'default-case': 'off',
'eslint-comments/disable-enable-pair': ['error', { allowWholeFile: true }],
'eslint-comments/no-aggregating-enable': 'error',
'eslint-comments/no-duplicate-disable': 'error',
'eslint-comments/no-unlimited-disable': 'error',
'eslint-comments/no-unused-disable': 'error',
'eslint-comments/no-unused-enable': 'error',
'eslint-comments/no-use': [
'error',
{
allow: [
'eslint-disable',
'eslint-disable-line',
'eslint-disable-next-line',
'eslint-enable',
'global',
],
},
],
'functional/functional-parameters': [
'error',
{
allowArgumentsKeyword: false,
allowRestParameter: false,
enforceParameterCount: false,
},
],
'functional/no-conditional-statements': [
'error',
{ allowReturningBranches: true },
],
'functional/prefer-immutable-types': 'off',
'functional/type-declaration-immutability': 'off',
'id-length': 'off',
'import/extensions': ['error', 'always'],
'import/first': 'error',
'import/newline-after-import': 'error',
'import/no-absolute-path': 'error',
'import/no-amd': 'error',
'import/no-commonjs': 'error',
'import/no-cycle': 'error',
'import/no-default-export': 'error',
'import/no-duplicates': 'error',
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
'import/no-internal-modules': ['error'],
'import/no-mutable-exports': 'error',
'import/no-named-default': 'error',
'import/no-named-export': 'off',
'import/no-self-import': 'error',
'import/no-useless-path-segments': 'error',
'import/order': [
'error',
{ alphabetize: { order: 'asc' }, 'newlines-between': 'always' },
],
'import/prefer-default-export': 'off',
'line-comment-position': ['error', { ignorePattern: 'cspell' }],
'max-lines': ['error', 1000],
'max-lines-per-function': 'off',
'max-params': 'off',
'max-statements': 'off',
'no-duplicate-imports': 'off',
'no-inline-comments': 'off',
'no-loss-of-precision': 'off',
'no-nested-ternary': 'off',
'no-ternary': 'off',
'no-undefined': 'off',
'no-warning-comments': 'off',
'one-var': 'off',
'sort-imports': [
'error',
{ ignoreCase: true, ignoreDeclarationSort: true },
],
'tsdoc/syntax': 'warn',
},
};