chore: fix lint errors

This commit is contained in:
Simen Bekkhus
2026-05-15 12:49:55 +02:00
parent 256904f238
commit 95828e8427
4 changed files with 19 additions and 10 deletions
+3 -3
View File
@@ -99,9 +99,9 @@ jest.mocked(obj.method).mockReturnValue(x); // typed cast for already-mocked
Never:
```ts
jest.fn().mockReturnValue(x) // widens to UnknownFunction
(x as jest.Mock).mockReturnValue(y) // cast soup
{foo: jest.fn()} as unknown as Real // construct typed instead
jest.fn().mockReturnValue(x); // widens to UnknownFunction
(x as jest.Mock).mockReturnValue(y); // cast soup
({foo: jest.fn()}) as unknown as Real; // construct typed instead
```
`beforeEach(() => jest.clearAllMocks())` fails `typecheck:tests` (return type widens). Use a block body: `beforeEach(() => { jest.clearAllMocks(); })`.
+8 -1
View File
@@ -817,7 +817,14 @@ const config = defineConfig(
'unicorn/prefer-number-properties': 'off',
},
},
// Instruction files for AI agents
{
files: ['**/CLAUDE.md/**', '.github/copilot-instructions.md/**'],
rules: {
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
},
},
{
ignores: [
'!.*',
@@ -6,7 +6,7 @@
*
*/
import {runInNewContext} from 'node:vm';
import {runInNewContext} from 'vm';
import jestExpect from '../';
import {
any,
+7 -5
View File
@@ -23,11 +23,13 @@ interface Reporter {
## Configuring reporters
```js
reporters: [
'default', // DefaultReporter
['jest-junit', {outputDirectory: './reports'}],
['<rootDir>/my-reporter.js', {}],
],
module.exports = {
reporters: [
'default', // DefaultReporter
['jest-junit', {outputDirectory: './reports'}],
['<rootDir>/my-reporter.js', {}],
],
};
```
Constructor receives `(globalConfig, reporterOptions, reporterContext)`. `SummaryReporter` is always appended by jest-core. Without `'default'` in the list, `DefaultReporter` is not added.