You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ci: Add lint + CI pipeline for the server package - #201
Adds ESLint (flat config) + Prettier matching the web package conventions for server package, new lint and format:check scripts, and a server job in .github/workflows/ci.yml that runs on every PR and push to main. Fixes all lint/format violations in existing server code.
Thanks for this — really solid work. The CI job mirrors the web job cleanly, .prettierrc.json matches the web package exactly, the ESLint flat config is sensible, and the source changes are pure Prettier reformatting with no logic changes (checked with a whitespace-insensitive diff across the larger files). Two things to fix before merge, and one note:
1. Don't format src/public/t.js. This file is the browser tracking pixel — it's a deliberately minified single-line IIFE that gets served to every tracked page, so Prettier expanding it to ~75 lines bloats the payload and undoes the intentional minification. You already (correctly) exclude src/public/** from ESLint via globalIgnores, so let's apply the same exclusion to Prettier. Please add a server/.prettierignore (mirroring how the web package ignores generated files) with:
node_modules/
src/public/
and restore src/public/t.js to its original minified form.
2. The lint script misses top-level src/ files.eslint src/**/*.js is expanded by the shell, and since globstar is off by default the ** collapses to a single level — so src/server.js and the src/test-*.js files never get linted (the main server entrypoint is skipped). Since the flat config's globalIgnores already scopes things, simplest fix:
"lint": "eslint ."
(format:check is unaffected — its glob is quoted, so Prettier does its own globstar expansion and already covers server.js.)
Note on package-lock.json: that change is correct and should stay — it's just the lockfile picking up the new ESLint/Prettier devDependencies, not reformatting. The new npm ci step in CI requires the lockfile to stay in sync with package.json, so reverting it would break the build.
Once t.js is excluded + restored and the lint script is fixed, this is good to merge. Thanks again!
Thanks for this — really solid work. The CI job mirrors the web job cleanly, .prettierrc.json matches the web package exactly, the ESLint flat config is sensible, and the source changes are pure Prettier reformatting with no logic changes (checked with a whitespace-insensitive diff across the larger files). Two things to fix before merge, and one note:
1. Don't format src/public/t.js. This file is the browser tracking pixel — it's a deliberately minified single-line IIFE that gets served to every tracked page, so Prettier expanding it to ~75 lines bloats the payload and undoes the intentional minification. You already (correctly) exclude src/public/** from ESLint via globalIgnores, so let's apply the same exclusion to Prettier. Please add a server/.prettierignore (mirroring how the web package ignores generated files) with:
node_modules/
src/public/
and restore src/public/t.js to its original minified form.
2. The lint script misses top-level src/ files.eslint src/**/*.js is expanded by the shell, and since globstar is off by default the ** collapses to a single level — so src/server.js and the src/test-*.js files never get linted (the main server entrypoint is skipped). Since the flat config's globalIgnores already scopes things, simplest fix:
"lint": "eslint ."
(format:check is unaffected — its glob is quoted, so Prettier does its own globstar expansion and already covers server.js.)
Note on package-lock.json: that change is correct and should stay — it's just the lockfile picking up the new ESLint/Prettier devDependencies, not reformatting. The new npm ci step in CI requires the lockfile to stay in sync with package.json, so reverting it would break the build.
Once t.js is excluded + restored and the lint script is fixed, this is good to merge. Thanks again!
@gkhngyk I have made the requested changes, please review again.
Merged — both points addressed perfectly: .prettierignore excludes src/public/ and t.js is back to its original minified form, and lint now uses eslint . so server.js is covered too. Server lint + CI is a great addition. Thanks for seeing it through! 🙌
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
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.
Adds ESLint (flat config) + Prettier matching the web package conventions for server package, new
lintandformat:checkscripts, and aserverjob in.github/workflows/ci.ymlthat runs on every PR and push to main. Fixes all lint/format violations in existing server code.Closes: #124