@@ -4,8 +4,8 @@ module.exports = {
44 node : true ,
55 } ,
66 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 ' ] ,
99 overrides : [
1010 {
1111 // Configuration for JavaScript files
@@ -43,7 +43,7 @@ module.exports = {
4343 // Enforce type annotations to maintain consistency. This is especially important as
4444 // we have a public API, so we want changes to be very explicit.
4545 '@typescript-eslint/typedef' : [ 'error' , { arrowParameter : false } ] ,
46- '@typescript-eslint/explicit-function-return-type' : 'error' ,
46+ '@typescript-eslint/explicit-function-return-type' : [ 'error' , { allowExpressions : true } ] ,
4747
4848 // Consistent ordering of fields, methods and constructors for classes should be enforced
4949 '@typescript-eslint/member-ordering' : 'error' ,
@@ -87,21 +87,35 @@ module.exports = {
8787 'simple-import-sort/sort' : 'error' ,
8888 'sort-imports' : 'off' ,
8989 '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' ,
90101 } ,
91102 } ,
92103 {
93104 // Configuration for files under src
94105 files : [ 'src/**/*' ] ,
95106 rules : {
96107 // 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' ,
98109
99110 // JSDOC comments are required for classes and methods. As we have a public facing codebase, documentation,
100111 // even if it may seems excessive at times, is important to emphasize. Turned off in tests.
101112 'jsdoc/require-jsdoc' : [
102113 'error' ,
103114 { require : { ClassDeclaration : true , MethodDefinition : true } , checkConstructors : false } ,
104115 ] ,
116+
117+ // All imports should be accounted for
118+ 'import/no-extraneous-dependencies' : 'error' ,
105119 } ,
106120 } ,
107121 {
@@ -116,6 +130,7 @@ module.exports = {
116130 '@typescript-eslint/explicit-function-return-type' : 'off' ,
117131 'no-unused-expressions' : 'off' ,
118132 '@typescript-eslint/no-unused-expressions' : 'off' ,
133+ '@typescript-eslint/no-unsafe-member-access' : 'off' ,
119134 } ,
120135 } ,
121136 {
@@ -164,5 +179,8 @@ module.exports = {
164179
165180 // imports should be ordered.
166181 'import/order' : [ 'error' , { 'newlines-between' : 'always' } ] ,
182+
183+ // Make sure for in loops check for properties
184+ 'guard-for-in' : 'error' ,
167185 } ,
168186} ;
0 commit comments