Update the ESLint valid-styles
rule to use a strict CSS value parser.
#728
Labels
enhancement
New feature or request
valid-styles
rule to use a strict CSS value parser.
#728
The ESlint
valid-styles
rules was initially created by refactoring static types. As such, in many cases it allows arbitrary strings when only a particular CSS type should be allowed.We have some occasional use regular expressions, but, overall, the the rule is far too permissive and easily allows invalid CSS values.
The Task
The ESLint rule should be updated to use a proper CSS value parser to properly validate the values used with StyleX. For example, a
width
must be a valid length, CSS variable orcalc
expression and not just any arbitrary string.The
nmn/css-value-parser
can be used as the parser for this use-case. (See also, #721 and #722)The text was updated successfully, but these errors were encountered: