fix(ci): disable lines-between-class-members + prefer-arrow-callback for test files
CI check:eslint failed with 28 errors in two test files: callSounds.test.ts
(lines-between-class-members on mock classes) and lotusDenoiseUtils.test.ts
(prefer-arrow-callback on `function AudioWorkletNode(){}` constructor mocks —
arrows aren't constructable, so auto-fixing would break the test). Both are
stylistic false-positives for test code; relax them in the existing test-file
override next to max-classes-per-file. `npm run check:eslint` now exits 0.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+7
-1
@@ -144,10 +144,16 @@ export default [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// Test files commonly define several small mock/fake classes.
|
// Test files commonly define several small mock/fake classes and named
|
||||||
|
// function expressions used as constructor mocks (e.g.
|
||||||
|
// `setGlobal('AudioWorkletNode', function AudioWorkletNode(){})`), which must
|
||||||
|
// NOT be rewritten to arrows (arrows aren't constructable). Relax the
|
||||||
|
// stylistic class/callback rules here.
|
||||||
files: ['**/*.test.ts', '**/*.test.tsx'],
|
files: ['**/*.test.ts', '**/*.test.tsx'],
|
||||||
rules: {
|
rules: {
|
||||||
'max-classes-per-file': 'off',
|
'max-classes-per-file': 'off',
|
||||||
|
'lines-between-class-members': 'off',
|
||||||
|
'prefer-arrow-callback': 'off',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user