From 50c08aa35ab1046c0298ff4679bc3e85705d8f12 Mon Sep 17 00:00:00 2001 From: MareStare Date: Tue, 4 Mar 2025 02:47:51 +0000 Subject: [PATCH 1/2] 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*'], + }, + ], }, }, ); From cb380b0eff1f6b8bb69d7661fc69dfc0dfa17446 Mon Sep 17 00:00:00 2001 From: MareStare Date: Tue, 4 Mar 2025 02:59:19 +0000 Subject: [PATCH 2/2] Convert a comment into a TODO --- assets/eslint.config.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/eslint.config.js b/assets/eslint.config.js index ee3c572c..aaae607d 100644 --- a/assets/eslint.config.js +++ b/assets/eslint.config.js @@ -266,7 +266,8 @@ export default tsEslint.config( 'no-redeclare': 'off', 'no-shadow': 'off', - // Often conflicts with prettier. In fact, prettier should just be enforced by CI. + // Often conflicts with prettier. + // TODO: prettier should just be enforced by CI. 'no-extra-parens': 'off', '@typescript-eslint/no-unused-vars': [