diff --git a/.changeset/small-meals-scream.md b/.changeset/small-meals-scream.md new file mode 100644 index 000000000..b124d8481 --- /dev/null +++ b/.changeset/small-meals-scream.md @@ -0,0 +1,5 @@ +--- +'eslint-config-skuba': minor +--- + +Disable `@typescript-eslint/only-throw-error` in test files diff --git a/packages/eslint-config-skuba/index.js b/packages/eslint-config-skuba/index.js index 9c0c8d469..79704533d 100644 --- a/packages/eslint-config-skuba/index.js +++ b/packages/eslint-config-skuba/index.js @@ -171,6 +171,9 @@ module.exports = [ // Allow e.g. `/** @jest-environment jsdom */` directives 'tsdoc/syntax': 'off', + // Allow edge-case error handling tests, including from skuba's templates + '@typescript-eslint/only-throw-error': 'off', + // Allow potential floating promises in tests only for Koa compatibility // https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-misused-promises.md#checksvoidreturn // https://github.com/DefinitelyTyped/DefinitelyTyped/pull/42551#issuecomment-648816869 diff --git a/template/koa-rest-api/src/framework/server.test.ts b/template/koa-rest-api/src/framework/server.test.ts index 7953e28ba..8bf87fedb 100644 --- a/template/koa-rest-api/src/framework/server.test.ts +++ b/template/koa-rest-api/src/framework/server.test.ts @@ -203,7 +203,6 @@ describe('createApp', () => { it('handles null error', async () => { middleware.mockImplementation(() => { - /* eslint-disable-next-line @typescript-eslint/only-throw-error */ throw null; });