How should we treat Stylelint Polaris warnings in Shopify/web? #8392
-
Right now, Shopify/web's CI fails stylelint on both warnings and errors. This doesn't allow us to tier warnings and failures from Stylelint Polaris. Having warnings could allow us to nudge developers to fix coverage problems without blocking them which would be useful for rules like layout. Possible solutions
Lets say one day when we enable the Layout stylelint rules, someone:
1. Make them add a disable context messageThis is equivalent to what we have today failing on both warnings and errors. Once a developer adds a disable context message, both errors and warnings will pass
2. Create two parallel CI steps for Stylelint in Shopify/WebIn VSCode we would use the joint config so that all errors and warnings are shown in there. On CI, we could run one step with the basic shopify/web stylelint config and one step with the stylelint polaris config. We could even modify our Polaris step to not report warnings at all in the CI so it doesn't get noisy and the warning experience would only be in VSCode.
3. Let them ship the PR (don't fail stylelint warnings in web)
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I’m partial to no. 2 or 3. I don’t think warnings should be blocking where disabled comments are required. It would equate to a lot of time for developers and I’m not confident the disabled comments would give us a strong signal vs noise. If we have clear guidance around resolving a specific warning, arguably it can be turned into an error. In addition to seeing the warning in VSCode I like exploring surfacing warnings async and non-blocking with caution tape bot or something similar where we could use that to potentially solicit feedback, educate about the warning, or educate about adding a reason via comment, etc. My gut feeling is a majority of warnings can be ignored entirely and the code is needed, but there is a chunk or warnings that are due to not using the components/tokens properly, shortcomings of components/tokens, etc. |
Beta Was this translation helpful? Give feedback.
-
Thanks @samrose3 and @tmlayton for your input! I'm going to go with #2 as I agree with both of your points and this will be less friction with the web platform's current stylelint step. |
Beta Was this translation helpful? Give feedback.
Thanks @samrose3 and @tmlayton for your input! I'm going to go with #2 as I agree with both of your points and this will be less friction with the web platform's current stylelint step.