-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[stylelint-polaris] Validate rule configs #7827
Description
tl;dr:
The rule settings configured have a few problems that need to be addressed before we ship @shopify/stylelint-polaris
to Shopify/web.
Why
The rule configurations in each category need to be checked for validity to address known (and uncover unknown) issues before we ship to Shopify/web
. Look for and flag or fix:
- Unwarranted or duplicate errors or warnings
- e.g., property present in
property-disallowed-list
anddeclaration-property-value-disallowed-list
- e.g., property present in
- Unreported errors or warnings
- e.g., colors =>
declaration-property-value-disallowed-list
=>opacity: [/(?!0|1)\d$|^\d{2,}|^[1-9]+\.|^\d+\.\d+\.|^0\.\d{3,}/]
doesn't report problems at all as configured
- e.g., colors =>
- Properties in the
property-disallowed-list
that map to specific components and should move todeclaration-property-value-disallowed-list
and have detailed error messages- e.g., should
position
be wholly disallowed, or shouldposition sticky;
be specifically disallowed since folks should use theSticky
component
- e.g., should
- Regexs that don't do what they're intended to
- Other unknown discrepancies you may find
How
To uncover issues with the rule configs, prioritize validating the disabled errors and warnings for each category using the stylesheets of some of the more complex/configurable @shopify/polaris
components, such as:
- Button.scss
- TextField.scss
- Frame.scss
- RangeSlider.scss
- IndexTable.scss
For example, run yarn stylelint polaris-react/src/components/Button/Button.scss --ignore-disables
and check that errors and warnings are valid.
Let's split up the work by category so we can move quickly without duplicating effort (just add your name to the category when you start to tackle it).
- Colors (Chloe)
- Motion (Sophie: no failures in polaris-react but I also searched to make sure this was true)
- Typography (Sophie)
- Layout (Chloe)
- Spacing (Sophie)
- Shape (Sophie)
- Depth (Sophie)
- Z-index (Sophie)
- Conventions (Sophie)
- Media queries (Sophie)
- Legacy (Sophie)