Plugins or rules to consider for inclusion
thibaudcolas opened this issue · 1 comments
We didn’t have time to look at additional plugins we could benefit from – here is the list I wanted us to consider:
-
Validation of which properties are incompatible between one another. I’m not sure we need this, but it can catch a few bugs / dead styles.
https://github.com/kristerkari/stylelint-declaration-block-no-ignored-properties -
Very opinionated: enforce that specific properties (e.g.
color
, font-weight, etc) must be set with a variable rather than hard-coded
https://github.com/AndyOGo/stylelint-declaration-strict-value. I’ve found this useful, but it’s all or nothing -
Also rather opinionated: check that the styles match your browser support targets,
https://github.com/ismay/stylelint-no-unsupported-browser-features. At Torchbox we tend to be ok with older browsers having a functional but less refined version of UIs, so this might be more trouble than is worth. But interesting concept nonetheless. -
Opinionated rules to enforce writing styles that are accessible. Very "all or nothing" too,
https://github.com/YozhikM/stylelint-a11y -
Enforce the ordering of style declarations (e.g. positions then display then flex then grid then box model, typography, colors, etc)
https://github.com/hudochenkov/stylelint-order/blob/master/rules/properties-order/README.md
- stylelint-declaration-block-no-ignored-properties: does not seem valuable enough
- stylelint-no-unsupported-browser-features: too opinionated
- stylelint-a11y: reviewed with @SimonDEvans, we’ll add some rules that seem like they could catch occasional issues
- stylelint-order
properties-order
: not valuable enough / too opinionated
Rules to add:
stylelint-a11y
We will be enabling the following:
+ 'a11y/content-property-no-static-value': true,
+ 'a11y/no-obsolete-attribute': true,
+ 'a11y/no-obsolete-element': true,
+ 'a11y/no-text-align-justify': true,
+ 'a11y/no-outline-none': true,
stylelint-declaration-strict-value
"scale-unlimited/declaration-strict-value": [
["/color/"],
{
"ignoreKeywords": ["currentColor", "inherit", "transparent", "initial"],
},
],