Skip to content
This repository was archived by the owner on Sep 30, 2025. It is now read-only.
This repository was archived by the owner on Sep 30, 2025. It is now read-only.

[stylelint-polaris] Validate rule configs #7827

@chloerice

Description

@chloerice

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 and declaration-property-value-disallowed-list
  • 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
  • Properties in the property-disallowed-list that map to specific components and should move to declaration-property-value-disallowed-list and have detailed error messages
    • e.g., should position be wholly disallowed, or should position sticky; be specifically disallowed since folks should use the Sticky component
  • 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)

Metadata

Metadata

Labels

stylelint-polarisRelated to the the @shopify/stylelint-polaris package

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions