Fix npm run lint and run it in CI - #61
Merged
Merged
Conversation
.prettierrc sets singleQuote, which Prettier also applies to YAML, so `prettier -c .` flagged the double-quoted strings in dependabot.yml, codeql.yml and zizmor.yml, and `npm run lint` failed on main. CI never ran lint, so it went unnoticed. Quoting is the only change: each file parses to the same YAML as before. The other workflows already use single quotes.
The build job runs `npm run build:prod`, which, unlike `npm run build`, has no prebuild hook, so neither ESLint nor Prettier ran in CI. Add a lint job that runs `npm run lint` once on Ubuntu, since neither tool's results depend on the OS. It skips the build job's node_modules cache step: npm ci deletes node_modules before installing, so that cache never takes effect.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Fixes
npm run lint, which already fails onmain, and runs it in CI so it can't silently break again..prettierrcsetssingleQuote: true, which Prettier also applies to YAML. Soprettier -c .flagged the double-quoted strings in.github/dependabot.yml,.github/workflows/codeql.ymland.github/workflows/zizmor.yml. The fix isprettier --writeon those three files. Only the quoting changes; each file parses to the same YAML as before. The other workflows already use single quotes.buildjob runsnpm run build:prod. Unlikenpm run build, that has noprebuildhook, so neither ESLint nor Prettier ever ran in CI. The newlintjob runsnpm run lintonce on Ubuntu, since neither tool's results depend on the OS.buildjob'snode_modulescache step:npm cideletesnode_modulesbefore installing, so that cache never takes effect.Required check
lintis now a required status check onmain, next to the twobuildchecks. It's pinned to the GitHub Actions app, like the Ubuntu build check. No other open PRs are affected. Any PR opened from a branch that predates this merge won't reportlintuntil it's rebased ontomain.Test plan
npm run lintpasses locally; it fails onmain.zizmor --offline .github/workflows/: no findings, same asmain. The only new suppressed item isanonymous-definition(informational) for the unnamedlintjob, which matches the unnamedbuildjob.lintjob.