Skip to content

ci: Add lint + CI pipeline for the server package - #201

Merged
gkhngyk merged 2 commits into
ansvisor:mainfrom
Pallavikumarimdb:feat/add-lint-and-CI-pipeline-fo-server
Jun 10, 2026
Merged

gkhngyk merged 2 commits into
ansvisor:mainfrom
Pallavikumarimdb:feat/add-lint-and-CI-pipeline-fo-server

Conversation

@Pallavikumarimdb

@Pallavikumarimdb Pallavikumarimdb commented Jun 8, 2026 •

Copy link
Copy Markdown
Contributor

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.

Closes: #124

@Pallavikumarimdb
Pallavikumarimdb marked this pull request as ready for review June 8, 2026 19:26
@gkhngyk

gkhngyk commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

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!

@Pallavikumarimdb
Pallavikumarimdb force-pushed the feat/add-lint-and-CI-pipeline-fo-server branch from 800fdef to 33895c0 Compare June 9, 2026 19:13
@Pallavikumarimdb

Copy link
Copy Markdown
Contributor Author

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.

@gkhngyk
gkhngyk merged commit 4c2a8e3 into ansvisor:main Jun 10, 2026
2 checks passed
@gkhngyk

gkhngyk commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

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! 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: add lint + CI pipeline for the server package

2 participants