Skip to content

Use stylelint-prettier rules with stylelint#10725

Merged
alecslupu merged 2 commits intodecidim:developfrom
mainio:chore/stylelint-prettier
Apr 18, 2023
Merged

Use stylelint-prettier rules with stylelint#10725
alecslupu merged 2 commits intodecidim:developfrom
mainio:chore/stylelint-prettier

Conversation

@ahukkanen
Copy link
Copy Markdown
Contributor

@ahukkanen ahukkanen commented Apr 15, 2023

🎩 What? Why?

After #10669 we no longer get the error lens inline errors in VSCode for the SCSS files which I personally found very useful in order to fix these issues on the fly and saving time in the development process.

Through stylelint-prettier package, we can introduce the prettier rules to stylelint which would help this. This also makes the "Format SCSS files" step in the CI pipeline unnecessary because the stylelint step should already spot these issues.

📌 Related Issues

Testing

  1. Create an SCSS lint error (e.g. remove a space before the opening brace {)
  2. Run npm run stylelint
  3. See the prettier error printed out

📷 Screenshots

Error lens output in VSCode

@ahukkanen ahukkanen added module: core target: developer-experience type: change PRs that implement a change for an existing feature labels Apr 15, 2023
Copy link
Copy Markdown
Contributor

@alecslupu alecslupu left a comment

Choose a reason for hiding this comment

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

I like the "recommended" part to be added. But I do not want to remove the prettier npm command in lint code.

It becomes very easy for first time contributors, or for people that do not have the prettier properly configured ( like me - running in docker, no npm command available ) to break things in the project structure.

@alecslupu alecslupu merged commit ecfb0d7 into decidim:develop Apr 18, 2023
@ahukkanen ahukkanen deleted the chore/stylelint-prettier branch April 18, 2023 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: core target: developer-experience type: change PRs that implement a change for an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants