Skip to content

feat(lint): adjust LESS whitespaces to match prettier format #2612

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

Merged
merged 18 commits into from
Dec 16, 2022

Conversation

mvorisek
Copy link
Contributor

@mvorisek mvorisek commented Dec 15, 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.

@mvorisek
Copy link
Contributor Author

Let's land these few CS changes now, PR #2611 needs some Prettier tool fixes, so PR #2611 cannot be finished soon.

And good news! With this PR, the era of 10k LOC changed daily is done. For JS and LESS. Thank you @lubber-de ❤️

@mvorisek mvorisek changed the title Adjust LESS whitespaces to match Prettier Adjust LESS whitespaces to match Prettier format Dec 16, 2022
#([0-9a-f])\1([0-9a-f])\2([0-9a-f])\3
@mvorisek
Copy link
Contributor Author

mvorisek commented Dec 16, 2022

To verify this PR I run build before all changes and after. Then I run Prettier on both data (Prettier seems quite safe in sense of corrupting AST or comments).

There are only a few changes in semantic.css.min like:

image

image

image

image

will selectors with removed space before :: match always the same elements?

I have also double checked all rtl: comments (#2612 (comment)) and I can confirm none of them were removed after first LESS CS PR (e589cd1)

@mvorisek mvorisek marked this pull request as ready for review December 16, 2022 14:02
@auto-assign auto-assign bot requested a review from lubber-de December 16, 2022 14:02
@lubber-de
Copy link
Member

lubber-de commented Dec 16, 2022

To verify this PR I run build before all changes and after. Then I run Prettier on both data (Prettier seems quite safe in sense of corrupting AST or comments).

will selectors with removed space before :: match always the same elements?

No, those would have a different meaning. the space indicates a child node, and without the space it indicates the exact node

Damn, this is something that has been removed by the whitespace changes, which i did not recognize.... This has to be reverted to the state it was in 2.9.0

@lubber-de
Copy link
Member

The wrong removement was done by fc431e8

@mvorisek mvorisek marked this pull request as draft December 16, 2022 16:59
@mvorisek
Copy link
Contributor Author

I marked this PR as a draft and will take care of it.

@mvorisek mvorisek marked this pull request as ready for review December 16, 2022 18:49
@mvorisek
Copy link
Contributor Author

The change of removed space before pseudo classes is fixed/reverted.

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.

Thank you, LGTM

@lubber-de lubber-de changed the title Adjust LESS whitespaces to match Prettier format feat(lint): adjust LESS whitespaces to match prettier format Dec 16, 2022
@lubber-de lubber-de merged commit 2ec6af4 into fomantic:develop Dec 16, 2022
@mvorisek mvorisek deleted the less_ws_for_prettier branch December 16, 2022 19:34
@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 16, 2022
@lubber-de lubber-de added this to the 2.9.1 milestone Dec 16, 2022
@lubber-de
Copy link
Member

lubber-de commented Dec 16, 2022

@mvorisek
When i run the lint locally, stylelint moans about the "each" statement... but the CI report does not do this.
Any idea what i am doing differently (yes, i ran the additional yarn packages from the ci as well to get the additional packages and i tried node 16 and 18.
image

@mvorisek
Copy link
Contributor Author

Did you installed all the packages that CI installs? It seems like the CSS is parsed without the less preprocessor. Maybe some config issue, you call the command from different pwd...

lubber-de added a commit to fomantic/create-fomantic-icons that referenced this pull request Dec 16, 2022
Change template to double quotes again to match FUI linter as of fomantic/Fomantic-UI#2612
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