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

feat(lint): unify LESS files whitespaces and string quotes #2610

Merged
merged 17 commits into from
Dec 15, 2022

Conversation

mvorisek
Copy link
Contributor

This PR is part of GH-2594 but separated to integrate many whitespace changes (and other non functional changes) separately.

@mvorisek mvorisek changed the title Unify LESS files whitespaces Unify LESS files whitespaces and string quotes Dec 14, 2022
in_cart: \f218;
log_out: \f2f5;
sign_out: \f2f5;
zoom_in: '\f00e';
Copy link
Contributor Author

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

Copy link
Member

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)
@mvorisek mvorisek marked this pull request as ready for review December 15, 2022 00:15
Copy link
Member

@lubber-de lubber-de left a comment

Choose a reason for hiding this comment

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

LGTM

@lubber-de lubber-de changed the title Unify LESS files whitespaces and string quotes feat(lint): unify LESS files whitespaces and string quotes Dec 15, 2022
@lubber-de lubber-de merged commit fc431e8 into fomantic:develop Dec 15, 2022
@lubber-de lubber-de added this to the 2.9.1 milestone Dec 15, 2022
@lubber-de lubber-de added lang/css Anything involving CSS type/ci Anything related to CI/CD type/lint eslint / stylelint related changes only labels Dec 15, 2022
lubber-de added a commit to fomantic/create-fomantic-icons that referenced this pull request Dec 15, 2022
@mvorisek mvorisek deleted the unify_less_ws branch December 15, 2022 17:08
@mvorisek mvorisek restored the unify_less_ws branch December 16, 2022 18:29
@mvorisek mvorisek deleted the unify_less_ws branch December 16, 2022 18:47
lubber-de pushed a commit that referenced this pull request Dec 16, 2022
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.
lubber-de pushed a commit that referenced this pull request Dec 21, 2022
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang/css Anything involving CSS type/ci Anything related to CI/CD type/lint eslint / stylelint related changes only
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants