From 608bca2610480c4b7e4267f0e3133ff188d55108 Mon Sep 17 00:00:00 2001 From: Mathias Jakobsen Date: Fri, 25 Aug 2023 16:50:54 +0100 Subject: [PATCH] [misc] Disallow regex lookbehind during linting GitOrigin-RevId: e4f4d9ac1f9b0dcc6572cf1b32304575c9bb0ac4 --- services/web/.eslintrc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/web/.eslintrc b/services/web/.eslintrc index 499868f53c..19566de917 100644 --- a/services/web/.eslintrc +++ b/services/web/.eslintrc @@ -133,6 +133,11 @@ { "selector": "AssignmentExpression[left.object.object.name='window'][left.object.property.name='location'][left.property.name='href']", "message": "Modify location via useLocation instead of calling window.location methods directly" + }, + // prohibit using lookbehinds due to incidents with Safari simply crashing when the script is parsed + { + "selector": "Literal[regex.pattern=/\\(\\?<[!=]/]", + "message": "Lookbehind is not supported in older Safari versions." } ] }