@@ -4,8 +4,8 @@ module.exports = {
4
4
node : true ,
5
5
} ,
6
6
extends : [ 'prettier' , 'eslint:recommended' , 'plugin:import/errors' , 'plugin:import/warnings' ] ,
7
- plugins : [ 'sentry-sdk ' , 'simple-import-sort' ] ,
8
- ignorePatterns : [ 'eslint-plugin-sentry-sdk ' ] ,
7
+ plugins : [ 'sentry-sdks ' , 'simple-import-sort' ] ,
8
+ ignorePatterns : [ 'eslint-plugin-sentry-sdks ' ] ,
9
9
overrides : [
10
10
{
11
11
// Configuration for JavaScript files
@@ -43,7 +43,7 @@ module.exports = {
43
43
// Enforce type annotations to maintain consistency. This is especially important as
44
44
// we have a public API, so we want changes to be very explicit.
45
45
'@typescript-eslint/typedef' : [ 'error' , { arrowParameter : false } ] ,
46
- '@typescript-eslint/explicit-function-return-type' : 'error' ,
46
+ '@typescript-eslint/explicit-function-return-type' : [ 'error' , { allowExpressions : true } ] ,
47
47
48
48
// Consistent ordering of fields, methods and constructors for classes should be enforced
49
49
'@typescript-eslint/member-ordering' : 'error' ,
@@ -87,21 +87,35 @@ module.exports = {
87
87
'simple-import-sort/sort' : 'error' ,
88
88
'sort-imports' : 'off' ,
89
89
'import/order' : 'off' ,
90
+
91
+ // Disallow delete operator. We should make this operation opt in (by disabling this rule).
92
+ '@typescript-eslint/no-dynamic-delete' : 'error' ,
93
+
94
+ // We should prevent against overloads unless necessary.
95
+ '@typescript-eslint/unified-signatures' : 'error' ,
96
+
97
+ // Disallow unsafe any usage. We should enforce that types be used as possible, or unknown be used
98
+ // instead of any. This is especially important for methods that expose a public API, as users
99
+ // should know exactly what they have to provide to use those methods. Turned off in tests.
100
+ '@typescript-eslint/no-unsafe-member-access' : 'error' ,
90
101
} ,
91
102
} ,
92
103
{
93
104
// Configuration for files under src
94
105
files : [ 'src/**/*' ] ,
95
106
rules : {
96
107
// We want to prevent async await usage in our files to prevent uncessary bundle size.
97
- 'sentry-sdk /no-async-await' : 'error' ,
108
+ 'sentry-sdks /no-async-await' : 'error' ,
98
109
99
110
// JSDOC comments are required for classes and methods. As we have a public facing codebase, documentation,
100
111
// even if it may seems excessive at times, is important to emphasize. Turned off in tests.
101
112
'jsdoc/require-jsdoc' : [
102
113
'error' ,
103
114
{ require : { ClassDeclaration : true , MethodDefinition : true } , checkConstructors : false } ,
104
115
] ,
116
+
117
+ // All imports should be accounted for
118
+ 'import/no-extraneous-dependencies' : 'error' ,
105
119
} ,
106
120
} ,
107
121
{
@@ -116,6 +130,7 @@ module.exports = {
116
130
'@typescript-eslint/explicit-function-return-type' : 'off' ,
117
131
'no-unused-expressions' : 'off' ,
118
132
'@typescript-eslint/no-unused-expressions' : 'off' ,
133
+ '@typescript-eslint/no-unsafe-member-access' : 'off' ,
119
134
} ,
120
135
} ,
121
136
{
@@ -164,5 +179,8 @@ module.exports = {
164
179
165
180
// imports should be ordered.
166
181
'import/order' : [ 'error' , { 'newlines-between' : 'always' } ] ,
182
+
183
+ // Make sure for in loops check for properties
184
+ 'guard-for-in' : 'error' ,
167
185
} ,
168
186
} ;
0 commit comments