From 27a2aaa8699df1f6d6d67ab4128217011600afe4 Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Wed, 8 Jan 2025 10:44:47 -0800 Subject: [PATCH] chore(eslint): disallow `fdescribe`/`fit` (#5107) Fixes #5106 --- eslint.config.mjs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/eslint.config.mjs b/eslint.config.mjs index d4b3696eab..ee53dd3eea 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -242,6 +242,19 @@ export default tseslint.config( 'vitest/valid-expect-in-promise': 'error', 'vitest/no-conditional-tests': 'error', 'vitest/no-done-callback': 'error', + // Note that vitest's "no focused tests" rules do not cover `fit`/`fdescribe` + // https://github.com/salesforce/lwc/issues/5106 + 'no-restricted-globals': [ + 'error', + { + name: 'fdescribe', + message: 'Do not commit focused tests. Use `describe` instead.', + }, + { + name: 'fit', + message: 'Do not commit focused tests. Use `it` instead.', + }, + ], }, }, {