Skip to content
This repository has been archived by the owner on May 19, 2023. It is now read-only.

Add stylelint-scss rules #124

Merged
merged 2 commits into from Oct 11, 2021
Merged

Add stylelint-scss rules #124

merged 2 commits into from Oct 11, 2021

Conversation

rynpsc
Copy link
Contributor

@rynpsc rynpsc commented Sep 19, 2021

This PR disables rules from the stylelint-scss plugin that are unnecessary or might conflict with Prettier, closes #105. These rules are included within in main config rather than a seperate config and matches eslint-config-prettier. If the user does not have any scss rules configured they are ignored, therefore we don't need to introduce stylelint-scss as a peer dependency.

To enable support I've had to modify the checker as if a stylelint-scss rule is set to null in the users config i.e disabled, stylelint-scss reports the setting as an empty array rather than null. Therefore I've updated the script to check for both null and an empty array.

If a stylelint-scss rule is set to `null` in the users config, stylelint-scss reports the setting as an empty array rather than null.
@rynpsc rynpsc changed the title SCSS rules Add stylelint-scss rules Sep 19, 2021
@shannonmoeller
Copy link
Member

Thank you for the PR. Looks good.

I don't use Sass much anymore and I'd like to create more robust tests to prove how configs prevent conflicts eventually, but until then I'm just going to ask: How confident are you that these changes are necessary, correct, and complete?

@rynpsc
Copy link
Contributor Author

rynpsc commented Sep 20, 2021

Yes more tests would definitely be beneficial. For now my testing has been largely manual using the Prettier REPL and testing the examples within the stylelint-scss docs for all the rules that relate to style to see what Prettier would do to them. I then added add rules where Prettier would format them differently regardless of input. Most of the included rules are around if and else statements where no matter what you pass it Prettier does its own thing.

Copy link

@EvgenyOrekhov EvgenyOrekhov left a comment

Choose a reason for hiding this comment

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

👍

@shannonmoeller shannonmoeller merged commit 050b681 into prettier:master Oct 11, 2021
@shannonmoeller
Copy link
Member

Released as v9.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a separate config for stylelint-scss plugin
3 participants