2
2
3
3
module . exports = {
4
4
root : true ,
5
- env : {
6
- // @TODO : Can be removed, ES versions are cumulative:
7
- // https://stackoverflow.com/a/61688878
8
- // es6: true,
9
- // This seems to be what Node.js 18, 20 fully supports, but online documentation
10
- // isn't exactly crystal clear about what should be put here
11
- es2022 : true ,
12
- browser : true ,
13
- node : true ,
14
- } ,
5
+ env : { es2022 : true , browser : true , node : true } ,
15
6
// Standard linting for pure javascript files
16
- parserOptions : {
17
- // @TODO : Can be removed, as env ES version sets this too:
18
- // https://eslint.org/docs/latest/use/configure/language-options#specifying-environments
19
- // ecmaVersion: 2019,
20
- // @TODO : Remove because in JS files we use commonjs
21
- // sourceType: 'module',
22
- } ,
23
- // prettier must always be put last, so it overrides anything before it
24
7
extends : [
25
8
'eslint:recommended' ,
26
- // Disables all style rules
9
+ // Disables all style rules (must always be put last, so it overrides anything before it)
27
10
// https://prettier.io/docs/en/integrating-with-linters.html
28
11
// https://github.com/prettier/eslint-config-prettier
29
12
'prettier' ,
30
13
] ,
31
- rules : {
32
- // @TODO : Remove this rule, as it's a style rule covered by prettier and
33
- // it's deprecated https://eslint.org/docs/latest/rules/comma-dangle
34
- // 'comma-dangle': 'off',
35
- } ,
36
14
overrides : [
37
15
// TypeScript linting for TypeScript files
38
16
{
39
17
files : '*.ts' ,
40
18
plugins : [
41
19
'@typescript-eslint' ,
42
- // TSDoc is only meant for TS files https://tsdoc.org/
20
+ // https://tsdoc.org/
43
21
'eslint-plugin-tsdoc' ,
44
22
] ,
45
23
parser : '@typescript-eslint/parser' ,
46
24
parserOptions : { project : 'tsconfig.eslint.json' } ,
47
- // prettier must always be put last, so it overrides anything before it
48
25
extends : [
49
26
'plugin:@typescript-eslint/recommended-type-checked' ,
50
27
'prettier' ,
51
28
] ,
52
29
rules : {
53
- // @TODO : Remove as it doesn't seem to cause issues anymore with fn overloads
54
- // 'no-dupe-class-members': 'off', // Off due to conflict with typescript overload functions
55
30
'tsdoc/syntax' : 'error' ,
56
- // new TS rules begin @TODO : Remove these and adapt code
31
+ // @TODO : Remove the ones between "~~", adapt code
32
+ // ~~
57
33
'@typescript-eslint/prefer-as-const' : 'off' ,
58
34
'@typescript-eslint/ban-ts-comment' : 'off' ,
59
35
'@typescript-eslint/no-unsafe-call' : 'off' ,
@@ -62,40 +38,17 @@ module.exports = {
62
38
'@typescript-eslint/no-unsafe-assignment' : 'off' ,
63
39
'@typescript-eslint/no-unsafe-argument' : 'off' ,
64
40
'@typescript-eslint/no-floating-promises' : 'off' ,
65
- // new TS rules end
41
+ // ~~
66
42
'@typescript-eslint/array-type' : [ 'warn' , { default : 'array-simple' } ] ,
67
- // @TODO : Remove, as it's already off
68
- // '@typescript-eslint/return-await': 'off',
69
- // @TODO : Remove this rule, deprecated:
70
- // https://typescript-eslint.io/rules/space-before-function-paren/
71
- // '@typescript-eslint/space-before-function-paren': 0,
72
43
// @TODO : Should be careful with this rule, should leave it be and disable
73
44
// it within files where necessary with explanations
74
45
'@typescript-eslint/no-explicit-any' : 'off' ,
75
- // @TODO : Remove, as it's already off
76
- // '@typescript-eslint/explicit-function-return-type': 'off',
77
- // @TODO : Remove, as it's already off
78
- // '@typescript-eslint/no-throw-literal': 'off',
79
46
'@typescript-eslint/no-unused-vars' : [
80
47
'error' ,
81
48
// argsIgnorePattern: https://eslint.org/docs/latest/rules/no-unused-vars#argsignorepattern
82
49
// varsIgnorePattern: https://eslint.org/docs/latest/rules/no-unused-vars#varsignorepattern
83
50
{ args : 'all' , argsIgnorePattern : '^_' , varsIgnorePattern : '^_' } ,
84
51
] ,
85
- // @TODO : Remove this rule, as it's a style rule covered by prettier
86
- // '@typescript-eslint/member-delimiter-style': [
87
- // 'error',
88
- // {
89
- // multiline: {
90
- // delimiter: 'none', // 'none' or 'semi' or 'comma'
91
- // requireLast: true,
92
- // },
93
- // singleline: {
94
- // delimiter: 'semi', // 'semi' or 'comma'
95
- // requireLast: false,
96
- // },
97
- // },
98
- // ],
99
52
// @TODO : Not recommended to disable rule, should instead disable locally
100
53
// with explanation
101
54
'@typescript-eslint/ban-ts-ignore' : 'off' ,
@@ -112,9 +65,8 @@ module.exports = {
112
65
jest : true ,
113
66
'jest/globals' : true ,
114
67
} ,
115
- // prettier must always be put last, so it overrides anything before it
116
68
extends : [ 'plugin:jest/recommended' , 'prettier' ] ,
117
- // @TODO : Remove these rules and adapt code!
69
+ // @TODO : Remove all of these rules and adapt code!
118
70
rules : {
119
71
'jest/no-disabled-tests' : 'off' ,
120
72
'jest/expect-expect' : 'off' ,
0 commit comments