-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fix linting errors #915
Fix linting errors #915
Conversation
f681ef7
to
b99fb63
Compare
Deploying blog-site with Cloudflare Pages
|
9bd8867
to
b566d9d
Compare
16016fe
to
b566d9d
Compare
b566d9d
to
3674fdf
Compare
.github/workflows/precious.yml
Outdated
@@ -0,0 +1,45 @@ | |||
name: Precious |
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.
We probably don't need a Precious github action since we already have a linting github action, which lints the whole repo; linting the whole is preferred in CI since things like node module updates could catch linting errors that a git diff list would miss.
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.
It wasn't clear to me why the linting.yml
file didn't fail with all of the errors that were fixed in this PR though.
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.
The beauty of precious
is that we can run all sorts of linters and tidiers. For the blog, I would think adding something like typos
would be helpful. I guess we could still run that via the node scripts, but that gets cumbersome really quickly.
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.
It wasn't clear to me why the linting.yml file didn't fail with all of the errors that were fixed in this PR though.
It's because warnings don't return a non-zero exit code.
To fix this in stylelint, change defaultSeverity to error
.
For eslint, add the --max-warnings=0
cli argument
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.
Adding something for typos does seem ideal for something like the blog site.
Thanks, I've removed the precious github action in b164d44 if it is preferred to use only the linting github action.
#!/usr/bin/env bash | ||
|
||
# This is for installing precious and other 3rd party libs needed for linting | ||
# in CI |
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 guess this script would also need to be run at least once in dev environments, yeah?
|
||
You should also install our pre-commit hook. You can do this from your checkout | ||
by running `git/setup.sh`. These hooks do things like ensure that the code you | ||
commit is tidy and passes various linter checks. |
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.
This should also mention that precious needs to be installed and how to install it. For instance, I sometimes work on the blog site locally on my computer which currently doesn't have precious installed.
No description provided.