-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore/Issue-119: Setup project with Stylelint a11y plugin #121
Conversation
✅ Deploy Preview for super-tapioca-5987ce ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
79db066
to
d9e0ea3
Compare
stylelint.config.js
Outdated
@@ -1,3 +1,9 @@ | |||
export default { | |||
extends: ["stylelint-config-recommended"], | |||
plugins: ["@double-great/stylelint-a11y"], // -> no `extends` https://github.com/double-great/stylelint-a11y/issues/65 | |||
rules: { | |||
"a11y/media-prefers-reduced-motion": null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When set as true
, this rule will result in 2 failures:
src/components/side-nav/side-nav.module.css
31:5 ✖ Expected & #indicator is used with @media (prefers-reduced-motion) a11y/media-prefers-reduced-motion
src/components/table-of-contents/table-of-contents.module.css
41:5 ✖ Expected & #indicator is used with @media (prefers-reduced-motion) a11y/media-prefers-reduced-motion
✖ 2 problems (2 errors, 0 warnings)
I wasn't sure how much you wanted to refactor those 2 instances to wrap that rule (and others as well?) in a media query to meet the rule standard. Happy to do so, but wanted to get your thoughts first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this was probably an oversight on my part, we have been trying to abide by this in other components
https://github.com/ProjectEvergreen/www.greenwoodjs.dev/blob/main/src/components/capabilities/capabilities.css#L47
So we should handle these cases as well please 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the example. I wrapped the offending rulesets and all is passing.
lint-staged.config.js
Outdated
@@ -1,5 +1,5 @@ | |||
export default { | |||
"*.js": ["npm run lint:js --"], | |||
"*.js": ["npm run lint:js --", "npm run format --"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was this accidental? seems like this was something from the previous PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought so too, but main
doesn't seem to have it. Not sure where it was lost.
"*.js": ["npm run lint:js --"], |
EDIT:
Hmm... it was removed. Should I revert this change then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... it was removed. Should I revert this change then?
yes please, as it seems to work just as fine when applying the formatting to just the wildcard glob pattern. didn't seem like it needed to be run twice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, removed.
stylelint.config.js
Outdated
@@ -1,3 +1,9 @@ | |||
export default { | |||
extends: ["stylelint-config-recommended"], | |||
plugins: ["@double-great/stylelint-a11y"], // -> no `extends` https://github.com/double-great/stylelint-a11y/issues/65 | |||
rules: { | |||
"a11y/media-prefers-reduced-motion": null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this was probably an oversight on my part, we have been trying to abide by this in other components
https://github.com/ProjectEvergreen/www.greenwoodjs.dev/blob/main/src/components/capabilities/capabilities.css#L47
So we should handle these cases as well please 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sweet! Will get this merged up after the weekly meeting.
Related Issue
Fix #119
Summary of Changes
@double-great/stylelint-a11y
plugin:focus
along side:hover
use