Loose tailwind rules for eslint (#9496)

This commit is contained in:
Sergei Garin 2024-03-21 09:53:34 +04:00 committed by GitHub
parent 55a47dac20
commit 80e2d68cda
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -233,21 +233,6 @@ const RESTRICTED_SYNTAXES = [
'JSXElement[closingElement!=null]:not(:has(.children:matches(JSXText[raw=/\\S/], :not(JSXText))))',
message: 'Use self-closing tags (`<tag />`) for tags without children',
},
{
selector: `:matches(\
TemplateElement[value.raw=/\\b(?:size|w|h|p[xylrbt]?|m[xylrbt]?)-(?:\\d|px|\\[)/],\
Literal[value=/\\b(?:size|w|h|p[xylrbt]?|m[xylrbt]?)-(?:\\d|px|\\[)/]\
)`,
message: 'Fixed values for Tailwind `size-`, `w-`, `h-`, `p-`, `m-` are not allowed',
},
{
selector: `:matches(\
TemplateElement[value.raw=/\\b(?:opacity|gap|rounded(?:-[lrbtxy])?|leading|duration|grid-cols-fill)-(?:xs|sm|md|lg|xl|\\d|\\[)\\b/],\
Literal[value=/\\b(?:opacity|gap|rounded(?:-[lrbtxy])?|leading|duration|grid-cols-fill)-(?:xs|sm|md|lg|xl|\\d|\\[)\\b/]\
)`,
message:
'Fixed values for Tailwind `opacity-`, `rounded-`, `leading-`, `duration-` and `grid-cols-fill` are not allowed',
},
]
// ============================