ci: Add check to run ESLint on PRs/commits #715
Merged
+29
−17
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.
What kind of changes does this PR include?
Description
#710 added a script to allow linting
.astro
and.js
/.ts
files. Ideally we should keep on top of any lint errors before they proliferate, so this PR adds a job to our CI workflow to run the newpnpm run lint:eslint
command for PRs/commits.This could introduce a little extra friction to PRs if people need to fix lint errors before merging, but we’ve only enabled a fairly relaxed set of linter rules. You can see these rules here: https://eslint.org/docs/rules/ (marked with ✓). As this and the Astro-ESLint parser is new we may need to tweak the rules as we go, but my idea is that we can try and come up with a best practice config for others to use by dogfooding this. This also doesn’t impact Markdown files, so I don’t think we’re introducing extra friction for content authors, it’s more for layout, component, and other infrastructure code.
(You can see the new CI check running in the checks on this PR.)