From 50c08aa35ab1046c0298ff4679bc3e85705d8f12 Mon Sep 17 00:00:00 2001 From: MareStare Date: Tue, 4 Mar 2025 02:47:51 +0000 Subject: [PATCH] Allow `expect*` functions in vitest lints and ignore no-extra-parens in eslint --- assets/eslint.config.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/assets/eslint.config.js b/assets/eslint.config.js index 89159b71..ee3c572c 100644 --- a/assets/eslint.config.js +++ b/assets/eslint.config.js @@ -265,6 +265,10 @@ export default tsEslint.config( 'no-unused-vars': 'off', 'no-redeclare': 'off', 'no-shadow': 'off', + + // Often conflicts with prettier. In fact, prettier should just be enforced by CI. + 'no-extra-parens': 'off', + '@typescript-eslint/no-unused-vars': [ 2, { vars: 'all', args: 'after-used', varsIgnorePattern: '^_.*', argsIgnorePattern: '^_.*' }, @@ -285,6 +289,13 @@ export default tsEslint.config( 'no-unused-expressions': 0, 'vitest/valid-expect': 0, '@typescript-eslint/no-unused-expressions': 0, + 'vitest/expect-expect': [ + 'error', + { + // Custom `expectStuff()` functions must also count as assertions. + assertFunctionNames: ['expect*', '*.expect*'], + }, + ], }, }, );