Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable @typescript-eslint/only-throw-error in test files #1689

Merged
merged 2 commits into from
Sep 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading