From bf7c885eeff7c46a1a444038380fa33d0c686df4 Mon Sep 17 00:00:00 2001 From: David Cho-Lerat Date: Mon, 17 Jun 2024 11:07:46 +0200 Subject: [PATCH] SONAR-22413 Warn about use of Math.random() --- server/sonar-web/.eslintrc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/server/sonar-web/.eslintrc b/server/sonar-web/.eslintrc index ae429400752..49071ab4dbf 100644 --- a/server/sonar-web/.eslintrc +++ b/server/sonar-web/.eslintrc @@ -60,6 +60,14 @@ "local-rules/use-await-expect-async-matcher": "warn", "local-rules/no-implicit-coercion": "warn", "local-rules/no-api-imports": "warn", - "local-rules/no-within": "warn" + "local-rules/no-within": "warn", + "no-restricted-properties": [ + "warn", + { + "object": "Math", + "property": "random", + "message": "Tests can fail when the same random number is used as a key for several React elements." + } + ] } } -- 2.39.5