-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Turn off prettier for SASS, use stylelint instead #29697
Conversation
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.
A visual scan of a sample of the changes looks pretty good. I left a question about line breaks and @else
@if $size == $and-larger { | ||
$approved-value: 2; | ||
@media ( min-width: $breakpoint + 1 ) { | ||
@content; | ||
} | ||
} @else { | ||
} | ||
@else { |
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.
These breaks before an else aren't aligned with our typical style. Can that be improved so the else is on the same line as braces?
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.
Nice spotting @sirreal 😉 Turns out this can be indeed improved by configuring the block-closing-brace-newline-after rule. The @if
and @else
SCSS statements are actually an example in the docs.
I updated the Stylelint config in 4a4a8be and updated the file formatting in 3fa79b6
We have been using prettier recently to format SCSS files. Unfortunately, prettier has a number of outstanding bugs with comments and formatting that can easily break code. This patch turns off prettier for sass files and uses stylelint instead. This has the added bonus of enforcing (or at least reporting) our stylelint rules, something that has been sorely missing until now.
e63bcef
to
005f385
Compare
I rebased this PR onto the latest master, resolved conflicts that were introduced over the holidays, and patched the |
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.
Looks good, both code-wise and also after some calypso.live clicking-around.
…sh-2019 * origin/master: Disable select when only one domain exiists (#29873) Tiled galleries: Disable captions (#29776) Prevent scrolling up when opening a dialog (#29832) Gutenberg: Move Shortlinks to production (#29883) Gutenlypso: add convert to blocks dialog (#29790) Gutenberg: Move Related Posts to production blocks (#29650) Analytics: fix ad-tracking issue on signup for non-gdpr countries (#29741) Update mobile phone validation module (used for 2fa) (#29740) Gutenlypso: make sure titles load on second edit (#29877) Site Picker: Change wording of /page and /block-editor to match /post (#29859) Gutenberg: update copy link in page list to be editor aware Gutenberg: use core approach of initialEdits over overridePost Gutenberg: when duplicating a post, override post content Gutenberg: update duplicate url when Gutenlypso is enabled Refactor: Replace use of key-mirror with inline code (#29857) Fixes wrong selected domain name (#29824) Turn off prettier for SASS, use stylelint instead (#29697) Gutenberg: Add copy button to Shortlinks (#29556) add a section name to the body class (#29563)
Prettier has a bunch of bugs with SASS formatting that can break our styles. However, our style linting solution,
stylelint
has a--fix
option much likeeslint
. Let's try that instead...The first commit swaps prettier for eslint for sass files.
The second commit updates our stylelint rules to match our guidelines and fix some mistaken rule violations.
The last commit runs
--fix
over all our sass files.This should have no visible impact.