Skip to content

Commit

Permalink
Disable @typescript-eslint/only-throw-error in test files (#1689)
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronMoat committed Sep 28, 2024
1 parent f57eb0e commit 5fd488d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/small-meals-scream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'eslint-config-skuba': minor
---

Disable `@typescript-eslint/only-throw-error` in test files
3 changes: 3 additions & 0 deletions packages/eslint-config-skuba/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion template/koa-rest-api/src/framework/server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ describe('createApp', () => {

it('handles null error', async () => {
middleware.mockImplementation(() => {
/* eslint-disable-next-line @typescript-eslint/only-throw-error */
throw null;
});

Expand Down

0 comments on commit 5fd488d

Please sign in to comment.