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

Update stylelint config defaults #2916

Merged
merged 4 commits into from
Oct 13, 2022
Merged

Update stylelint config defaults #2916

merged 4 commits into from
Oct 13, 2022

Conversation

colinrotherham
Copy link
Contributor

One more quick update to fully close #2710

This PR does three things:

  1. Moves to the newer stylelint.config.js config type
  2. Ensures stylelint fully understands SCSS files via postcss-scss custom syntax
  3. Update the "ignore list" to include '**/*.{cjs,js,mjs}' files and built CSS

Why the changes?

When we upgraded to Stylelint v14 (see migration guide) we accidentally opted in to "CSS-in-JS" validation. We didn't notice this in our GitHub workflow or via gulp scss:lint because we didn't lint anything but *.scss files:

stylelint 'app/**/*.scss' 'src/**/*.scss'

BUT for code editors using a Stylelint plugin they see errors in all files that Stylelint supports, including JavaScript:

Stylelint showing  Missed semicolon (CssSyntaxError)  for jest config js

By default stylelint will attempt to check for “CSS in JS” but this is causing issues to be flagged in editors when destructuring objects
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2916 October 13, 2022 11:55 Inactive
@colinrotherham colinrotherham changed the title Stylelint config Update stylelint config defaults Oct 13, 2022
@colinrotherham
Copy link
Contributor Author

This PR was related to #2243

Copy link
Contributor

@domoscargin domoscargin left a comment

Choose a reason for hiding this comment

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

All looks good to me and works locally on VS Code.

@colinrotherham colinrotherham merged commit 37f12cc into main Oct 13, 2022
@colinrotherham colinrotherham deleted the stylelint-config branch October 13, 2022 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor linting tasks to remove Gulp
3 participants