[misc] Disallow regex lookbehind during linting

GitOrigin-RevId: e4f4d9ac1f9b0dcc6572cf1b32304575c9bb0ac4
This commit is contained in:
Mathias Jakobsen 2023-08-25 16:50:54 +01:00 committed by Copybot
parent 7c9971cce9
commit 608bca2610

View file

@ -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."
}
]
}