From f080e946c4bb297b3ac7f61106589d4dfc001fd8 Mon Sep 17 00:00:00 2001 From: Ramon Wenger Date: Thu, 7 Mar 2024 13:15:29 +0100 Subject: [PATCH] Add linting rule for cypress tests to reject .only calls --- client/.eslintrc.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/.eslintrc.js b/client/.eslintrc.js index 251f3e6d..2fd53585 100644 --- a/client/.eslintrc.js +++ b/client/.eslintrc.js @@ -103,5 +103,12 @@ module.exports = { caughtErrorsIgnorePattern: '^_', }, ], + 'no-restricted-syntax': [ + 'error', + { + selector: "CallExpression[callee.object.name=/^(describe|it|test)$/][callee.property.name='only']", + message: 'Found .only in test. Please remove it before committing.', + }, + ], }, };