This repository was archived by the owner on Jan 11, 2023. It is now read-only.
Use stylelint-prettier instead of stylelint formatting rules#8098
Merged
Conversation
jasonLaster
approved these changes
Mar 11, 2019
darkwing
pushed a commit
to darkwing/debugger.html
that referenced
this pull request
Mar 21, 2019
darkwing
pushed a commit
to darkwing/debugger.html
that referenced
this pull request
Mar 21, 2019
darkwing
pushed a commit
that referenced
this pull request
Mar 21, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two possible improvements to the stylelint config:
stylelint-prettierto replace most stylelint formatting rules@jasonLaster, you set up Prettier for CSS initially, do those changes look good to you?
Formatting
We have:
.stylelintrc;Both are close but not identical, and at least one file had conflicts in how it handles long selectors. Prettier would wrap those selectors using continuation indents, and stylelint would complain if you used its
"indentation"rule with any value.Turns out we can use
stylelint-prettierto take care of the formatting issues. 80% of our stylelint rules basically say whether to put a space before or after language punctuation.Only downside I've found: the reported errors are a bit more arcane. Not the exact errors, just quoting from the top of my mind:
Unexpected space character after "{" (name-of-rule-heere)Replace "." with "" (prettier/prettier)(Both report the file:line:column in the same way.)
Linting more files
Can we lint CSS files in
packages/devtools-*/src/**/*.css?In my tests it works pretty well, only requires a few fixes to align with Prettier rules.
We can add them to
bin/prettier.jstoo.Finally, out of the three stylesheets listed in
.stylelintignore, two don't exist anymore and one doesn't have linting issues, so I figured we could just remove this file.