forked from radixdlt/radixdlt-javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
97 lines (86 loc) · 3.16 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
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: __dirname,
project: [
'./packages/*/tsconfig.json',
'./packages/*/tsconfig.test.json',
],
},
plugins: ['@typescript-eslint', 'jest', 'functional', 'jsdoc'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:jest/recommended',
'plugin:jsdoc/recommended',
'plugin:functional/external-recommended', // https://github.com/jonaskello/eslint-plugin-functional
'plugin:functional/recommended', // https://github.com/jonaskello/eslint-plugin-functional
'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
env: {
node: true,
},
rules: {
complexity: ['error', 5],
'max-depth': ['error', 3],
'max-lines': [
'error',
{
max: 200,
skipBlankLines: true,
skipComments: true,
},
],
'max-lines-per-function': 'off',
'max-nested-callbacks': ['error', 3],
'max-params': ['error', 1],
'@typescript-eslint/no-unused-vars': [
'warn',
{ argsIgnorePattern: '^_' },
],
'@typescript-eslint/require-await': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-inferrable-types': 'off',
// ESLint-Plugin-Functional RULES
'functional/immutable-data': 'error',
'functional/no-let': 'off',
'functional/no-loop-statement': 'off',
'no-param-reassign': 'error',
'functional/no-try-statement': 'off',
'jsdoc/require-returns': 'off',
// ESLint-Plugin-JSDoc RULES
'jsdoc/check-param-names': 'off',
'jsdoc/require-param-type': 'off',
'jsdoc/require-param': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'jsdoc/require-returns-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'functional/no-expression-statement': 'off',
'functional/no-conditional-statement': 'off', // we like switch statements
'functional/no-mixed-type': 'off',
'functional/functional-parameters': 'off',
'functional/prefer-readonly-type': 'off', // false positive trigger on `Readonly<>` - which we like.
'jest/no-export': 'off',
'functional/no-return-void': 'off',
'max-params': 'off',
'functional/no-throw-statement': 'off',
complexity: 'off',
'functional/immutable-data': 'off',
'@typescript-eslint/no-unsafe-return': 'warn',
'@typescript-eslint/no-unsafe-member-access': 'warn',
'max-lines': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-namespace': 'off',
'functional/no-this-expression': 'off',
'@typescript-eslint/no-var-requires': 'off',
'arrow-body-style': ['warn', 'as-needed'],
'no-useless-return': 1,
'@typescript-eslint/restrict-template-expressions': 'off',
'no-param-reassign': 'off',
'@typescript-eslint/no-floating-promises': 'off',
},
}