-
Notifications
You must be signed in to change notification settings - Fork 3
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
Install CSS linting #507
Install CSS linting #507
Conversation
Hmm, I'm realizing that repo doesn't go into quite as much detail as our eslint one in terms of setting up scripts to lint styles. @spaceninja Do you think this is a good enough first step to merge and build on later or should we update this PR with more fancy-ness? |
Great question! By adding a However, it doesn't easily enable anyone to run linting from the command line or as part of CI or deploy steps. A pattern we've followed on several other other projects is adding a few scripts to
If this repo commits the CSS files, you'll want to lint the compiled CSS files. If not, then you'll want to lint the SCSS files. If this repo has any sort of CI, a hook could be added to the CI config to run linting. Eventually, when we're deploying this to npm, we'll want to run linting as part of a Another thing this PR doesn't touch (but is out of scope for this initial PR) is integrating Prettier into Stylelint. I just realized that would be a good blog post, talking about how to integrate Prettier into ESLint and Stylelint configs. The reason our documentation in the Stylelint config doesn't mention this is because it dates back to when I was first configuring this at my last job and was a lot more timid around suggesting config changes. The readme file for the Stylelint config definitely needs a note on adding scripts to run it. Action Items for this PR:
Future PRs:
Changes for our Lint configs:
|
@calebeby Any other best practices around running linting? |
For JS the linting is being run in GH Actions, the same could be done for this |
@dromo77 Do you think we can complete the action item for this PR that @spaceninja highlighted above before your end-of-day? |
@tylersticka I just added the lint scripts @spaceninja mentioned, I'm just not sure if I did correctly 🤔 |
Co-Authored-By: Scott Vandehey <scott@cloudfour.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved for adding linting. Either as part of this PR or as a followup, there are a number of CSS lint violations now.
I just pushed a few updates:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't run it locally but I saw that CI ran stylelint successfully so LGTM 👍
Installs stylelint-config-cloudfour, 🤞 that I installed it correctly. Changes to the config will be addressed in a separate PR.