forked from water-fountains/datablue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
65 lines (57 loc) · 2.04 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
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
env: {
node: true,
es2020: true,
},
plugins: ['@typescript-eslint', 'file-progress'],
// global rules for all file types
rules: {
'file-progress/activate': 1,
},
overrides: [
{
files: ['*.js'],
extends: [
'eslint:recommended',
// has to be last entry to be able to override other rules
'prettier',
],
},
{
files: ['*.ts'],
parserOptions: {
sourceType: 'module',
project: './tsconfig.json',
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended', // typescript rules
// TODO activate in addition
//'plugin:@typescript-eslint/recommended-requiring-type-checking',
// has to be last entry to be able to override other rules
'prettier',
],
rules: {
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'@typescript-eslint/explicit-module-boundary-types': 'error',
'@typescript-eslint/array-type': 'error',
'@typescript-eslint/ban-tslint-comment': 'error',
'@typescript-eslint/consistent-type-definitions': 'error',
'@typescript-eslint/no-extraneous-class': 'error',
'@typescript-eslint/no-implicit-any-catch': ['error', { allowExplicitAny: true }],
'@typescript-eslint/prefer-function-type': 'error',
'@typescript-eslint/prefer-optional-chain': 'error',
//TODO activate again (remove line is included in recommended) once we use unknown instead of any (or even better proper types)
'@typescript-eslint/no-explicit-any': 0,
//requires type checking
// TODO activate in addition
// '@typescript-eslint/no-unnecessary-condition': 'error',
// '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
// '@typescript-eslint/prefer-readonly': 'error',
// '@typescript-eslint/prefer-readonly-parameter-types': 'error',
},
},
],
};