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): add prettier formatter to assert LESS files whitespaces #2611

Merged
merged 16 commits into from
Dec 21, 2022

Conversation

mvorisek
Copy link
Contributor

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

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:

Prettier has no built in support to dump the diff - prettier/prettier#6885 - so we dump it in the CI using git.

@mvorisek mvorisek changed the title Add Prettier linter to assert LESS files whitespaces Add Prettier formatter to assert LESS files whitespaces Dec 15, 2022
@mvorisek mvorisek force-pushed the ci_less_ws_using_prettier branch 2 times, most recently from d47a5c4 to d368a93 Compare December 15, 2022 22:52
src/semantic.less Outdated Show resolved Hide resolved
@mvorisek mvorisek force-pushed the ci_less_ws_using_prettier branch 13 times, most recently from 342bde2 to d302347 Compare December 18, 2022 15:17
@mvorisek mvorisek marked this pull request as ready for review December 18, 2022 15:25
@mvorisek
Copy link
Contributor Author

PR is done, Prettier fixes with patches looks reasonable. Compiled semantic.min.css is binary the same as before this PR.

@lubber-de
Copy link
Member

Please resolve conflicts

@lubber-de
Copy link
Member

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.

Seriously? This is really hacky. You want to use a tool, which does not do what we need... Why not fork prettier.io instead and use that?

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