-
-
Notifications
You must be signed in to change notification settings - Fork 337
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
feat(lint): unify LESS files whitespaces and string quotes #2610
Conversation
((\w|-)+) +(:)
(^ *(?:\w|-)+: )(\\[0-9a-f]+)(;$)
in_cart: \f218; | ||
log_out: \f2f5; | ||
sign_out: \f2f5; | ||
zoom_in: '\f00e'; |
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.
fixes #2594 (comment)
the mentioned export/generator lib should be fixed to export the data with single quotes and no space before colon and one space after
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.
(?<!\w|\.)0(cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%|deg)(?!\w)
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.
LGTM
This PR reflects the changes of fomantic/Fomantic-UI#2610
This PR fixes whitespaces unfixed/undetected in GH-2610 and major whitespace changes required for future Prettier integration. Double quotes and lowecased hex colors are required by Prettier - prettier/prettier#5158 - and there is no config to change it. As long as we want to use Prettier, we must accept opinionated formatting by Prettier.
Compared to Stylelint, Prettier is very simple tool and I am quite supprised Stylelint is deprecating the whitespace rules in favor of Prettier. For LESS it seems ok, for JS, we should never enable Prettier as formatting is part of a code and improves readability. As Prettier is an opinionated formatter instead of an linter, we need to satisfy it everywhere without exceptions. When I was crafting this PR, I found several Prettier issues and proposed changes to Prettier: Fix semicolon duplicated at the end of LESS file prettier/prettier#14007 Fix no space after unary minus when followed by opening parenthesis in LESS prettier/prettier#14008 Do not change case of property name if inside a variable declaration in LESS prettier/prettier#14034 In this PR, these changes are contained and Prettier is patched before it is run. Once the changes are merged in prettier and stable release is made, they can be removed. This PR fixes minor whitespaces unfixed/undetected in GH-2610. And also asserts: PHP port of the LESS fails to compile colors.less #1832 feat(lint): add stylelint overrides and variation files #2593 (comment) Prettier has no built in support to dump the diff - prettier/prettier#6885 - so we dump it in the CI using git.
This PR is part of GH-2594 but separated to integrate many whitespace changes (and other non functional changes) separately.