-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.eslintrc.js
More file actions
98 lines (98 loc) · 2.23 KB
/
.eslintrc.js
File metadata and controls
98 lines (98 loc) · 2.23 KB
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
module.exports = {
root: true,
parserOptions: {
ecmaVersion: 11,
sourceType: 'module'
},
parser: '@typescript-eslint/parser',
env: {
browser: true,
node: true,
commonjs: true,
es2020: true,
jest: true
},
globals: {
NodeJS: 'readonly',
getRedisClientMock: 'readonly'
},
plugins: ['@typescript-eslint', 'jsdoc', 'prettier'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'airbnb/base',
'prettier',
'plugin:prettier/recommended'
],
rules: {
// Too restrictive, writing ugly code to defend against a very unlikely scenario: https://eslint.org/docs/rules/no-prototype-builtins
'no-prototype-builtins': 'off',
'no-bitwise': 'warn',
// why not?
'no-plusplus': 'off',
// Use function hoisting to improve code readability
'no-use-before-define': [
'error',
{ functions: false, classes: true, variables: true }
],
// allow voids as statements
// https://eslint.org/docs/rules/no-void
'no-void': [
'error',
{
allowAsStatement: true
}
],
// eslint does not detect exported members properly
'no-unused-vars': 'off',
// https://basarat.gitbooks.io/typescript/docs/tips/defaultIsBad.html
'import/prefer-default-export': 'off',
'jsdoc/require-jsdoc': [
'error',
{
contexts: [
'TSInterfaceDeclaration',
'TSTypeAliasDeclaration',
'TSEnumDeclaration'
]
}
],
'import/no-unresolved': 0,
'jsdoc/require-description': 1,
'jsdoc/require-param-description': 'error',
//'jsdoc/require-hyphen-before-param-description': 'error',
//'jsdoc/no-types': 'error',
'jsdoc/require-throws': 'error',
'jsdoc/require-param-type': 0,
'jsdoc/require-property-type': 0,
'jsdoc/require-returns-type': 0,
// treat wrong format as warning instead of error
// to inform the user and not slap him
'prettier/prettier': 'warn',
'import/no-extraneous-dependencies': 0
},
ignorePatterns: [
'scripts',
'configs',
'sample',
'bin',
'types',
'.eslintrc.js',
'docs',
'types.d.ts',
'*.spec.js',
'*.test.js',
'test/*.js',
'**/__tests__/**/*.js',
'rollup.config.js'
],
overrides: [
{
files: ['src/index.ts'],
rules: {
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-unused-vars': 'off'
}
}
]
};