Skip to content
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

Merged
merged 8 commits into from
Oct 31, 2024

Conversation

DevLab2425
Copy link
Contributor

@DevLab2425 DevLab2425 commented Oct 28, 2024

Related Issue

Fix #119

Summary of Changes

  • Include @double-great/stylelint-a11y plugin
  • Make changes to CSS files after plugin rules applied
    • Majority of changes were including :focus along side :hover use

Copy link

netlify bot commented Oct 28, 2024

Deploy Preview for super-tapioca-5987ce ready!

Name Link
🔨 Latest commit a041dbc
🔍 Latest deploy log https://app.netlify.com/sites/super-tapioca-5987ce/deploys/67217bc9bcfa4700089cf6a6
😎 Deploy Preview https://deploy-preview-121--super-tapioca-5987ce.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@DevLab2425 DevLab2425 force-pushed the issue-119-stylelint-with-a11y branch from 79db066 to d9e0ea3 Compare October 28, 2024 15:46
@@ -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,
Copy link
Contributor Author

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.

Copy link
Member

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 🙏

Copy link
Contributor Author

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.

@DevLab2425 DevLab2425 marked this pull request as ready for review October 28, 2024 15:57
@DevLab2425 DevLab2425 changed the title Issue-119: Setup project with Styleline a11y plugin Issue-119: Setup project with Stylelint a11y plugin Oct 28, 2024
@@ -1,5 +1,5 @@
export default {
"*.js": ["npm run lint:js --"],
"*.js": ["npm run lint:js --", "npm run format --"],
Copy link
Member

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?

Copy link
Contributor Author

@DevLab2425 DevLab2425 Oct 28, 2024

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?

e945636

Copy link
Member

@thescientist13 thescientist13 Oct 28, 2024

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, removed.

@@ -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,
Copy link
Member

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 🙏

@thescientist13 thescientist13 added enhancement New feature or request chore project maintenance related tasks labels Oct 28, 2024
@DevLab2425 DevLab2425 added the hacktoberfest-accepted Used to participate in Hacktoberfest label Oct 28, 2024
Copy link
Member

@thescientist13 thescientist13 left a 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.

@thescientist13 thescientist13 changed the title Issue-119: Setup project with Stylelint a11y plugin chore/Issue-119: Setup project with Stylelint a11y plugin Oct 31, 2024
@thescientist13 thescientist13 merged commit 7658a0c into main Oct 31, 2024
5 checks passed
@thescientist13 thescientist13 deleted the issue-119-stylelint-with-a11y branch October 31, 2024 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore project maintenance related tasks enhancement New feature or request hacktoberfest-accepted Used to participate in Hacktoberfest
Projects
None yet
Development

Successfully merging this pull request may close these issues.

setup project with Stylelint a11y plugin
2 participants