From ba0717bd05ca5912d5246d9dab099c12433c1303 Mon Sep 17 00:00:00 2001 From: Erik Marks Date: Wed, 28 Aug 2024 18:01:50 +0200 Subject: [PATCH] chore: Reconfigure @typescript-eslint/explicit-function-return-type --- .eslintrc.cjs | 10 ++++++++++ packages/shims/src/vitest-environment-endoified.ts | 5 +++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index ae7644b57..79a36054f 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -76,6 +76,16 @@ module.exports = { project: ['./tsconfig.packages.json'], }, rules: { + '@typescript-eslint/explicit-function-return-type': [ + 'error', + { + // To permit omitting the return type in situations like: + // `const obj = { foo: (bar: string) => bar };` + // We'll presume that `obj` has a type that enforces the return type. + allowExpressions: true, + }, + ], + '@typescript-eslint/no-explicit-any': 'error', // This rule is broken, and without the `allowAny` option, it reports a lot diff --git a/packages/shims/src/vitest-environment-endoified.ts b/packages/shims/src/vitest-environment-endoified.ts index 63a817387..1f0131bc6 100644 --- a/packages/shims/src/vitest-environment-endoified.ts +++ b/packages/shims/src/vitest-environment-endoified.ts @@ -13,8 +13,9 @@ export default { clearTimeout, }); }, - // eslint-disable-next-line no-empty-function - teardown(): void {}, + teardown(): void { + return undefined; + }, }; }, async setup() {