Update lint rule to ignore preview namespaces

This commit is contained in:
Icaro Motta 2024-05-14 21:58:42 -03:00
parent ae46356bab
commit 0d138b71d1
No known key found for this signature in database
GPG Key ID: 009557D9D014DF07
1 changed files with 4 additions and 1 deletions

View File

@ -2,8 +2,11 @@
# quo components namespace ends with style|utils|types|reaction-resource
# are not the component view, they are usually utils fns or styles
#
# We also ignore preview namespaces from this linter because they may require
# ?schema vars to auto-generate preview descriptors.
if rg --pcre2 --glob '!src/quo/**/*' 'quo\.components(\.[\w-]+)*\.[\w-]*(?<!style|utils|types|reaction-resource)(\s|\]|\n)' src; then
if rg --pcre2 --glob '!src/quo/**/*' --glob '!src/status_im/contexts/preview/quo/**/*' 'quo\.components(\.[\w-]+)*\.[\w-]*(?<!style|utils|types|reaction-resource)(\s|\]|\n)' src; then
echo "Found above direct require of quo component outside src/quo/"
echo "For more info, check the style guide https://github.com/status-im/status-mobile/blob/develop/doc/new-guidelines.md#requiring-quo-components"
exit 1