@@ -78,7 +78,8 @@ module.exports = [
7878 } ,
7979 } ,
8080
81- // Configuration for test files
81+ // Configuration for test files - Following FAANG best practices
82+ // Tests have different type safety requirements than production code
8283 {
8384 files : [ '**/*.test.ts' , '**/*.spec.ts' , '**/test/**/*.ts' ] ,
8485
@@ -109,6 +110,7 @@ module.exports = [
109110 beforeAll : 'readonly' ,
110111 afterAll : 'readonly' ,
111112 jest : 'readonly' ,
113+ fail : 'readonly' ,
112114 } ,
113115 } ,
114116
@@ -126,22 +128,26 @@ module.exports = [
126128 ...prettier . rules ,
127129 'prettier/prettier' : 'error' ,
128130
129- // Custom TypeScript-specific rules
130- '@typescript-eslint/explicit-function-return-type' : 'error' ,
131+ // Rules turned OFF for test files (incompatible with testing patterns)
132+ '@typescript-eslint/unbound-method' : 'off' , // Jest mocks are unbound by design
133+ '@typescript-eslint/only-throw-error' : 'off' , // Tests verify non-Error throw handling
134+ '@typescript-eslint/require-await' : 'off' , // Async test helpers often don't await
135+ '@typescript-eslint/explicit-function-return-type' : 'off' , // Test arrow functions are self-documenting
136+
137+ // Rules downgraded to WARN for test files (useful but not blocking)
138+ '@typescript-eslint/no-explicit-any' : 'warn' , // Relax from error to warn
139+ '@typescript-eslint/no-unsafe-assignment' : 'warn' , // Keep as warn
140+ '@typescript-eslint/no-unsafe-member-access' : 'warn' , // Keep as warn
141+ '@typescript-eslint/no-unsafe-call' : 'warn' , // Keep as warn
142+ '@typescript-eslint/no-unsafe-return' : 'warn' , // Downgrade from error to warn
143+ '@typescript-eslint/no-unsafe-argument' : 'warn' , // Add for consistency
144+
145+ // Standard test file overrides
131146 '@typescript-eslint/no-unused-vars' : [
132147 'error' ,
133148 { argsIgnorePattern : '^_' } ,
134149 ] ,
135- '@typescript-eslint/no-explicit-any' : 'error' ,
136- '@typescript-eslint/no-unsafe-assignment' : 'warn' ,
137- '@typescript-eslint/no-unsafe-member-access' : 'warn' ,
138- '@typescript-eslint/no-unsafe-call' : 'warn' ,
139- '@typescript-eslint/no-unsafe-return' : 'error' ,
140-
141- // Allow empty interfaces in tests
142150 '@typescript-eslint/no-empty-object-type' : 'off' ,
143-
144- // Disable no-undef in test files since Jest globals are defined
145151 'no-undef' : 'off' ,
146152 } ,
147153 } ,
0 commit comments