Skip to content

chore(010): scaffold ESLint, Prettier, Vitest, node:test, CI, VS Code config#2

Merged
astrobyte-dev merged 2 commits into
mainfrom
chore/010-scaffold-tooling
May 26, 2026
Merged

chore(010): scaffold ESLint, Prettier, Vitest, node:test, CI, VS Code config#2
astrobyte-dev merged 2 commits into
mainfrom
chore/010-scaffold-tooling

Conversation

@astrobyte-dev

Copy link
Copy Markdown
Owner

Closes the tooling-scaffolding portion of issue 010.

Stands up the static-check + test + build layer so every later issue's "done" criteria (npm run lint, npm test, npm run build) actually resolve. No production code touched except a single dead duplicate width key in VideoPlayer.jsx (user-approved one-line exception).

Highlights

  • Root: .editorconfig, .prettierrc.json, .prettierignore, .gitattributes, engines.node >= 22, lint/test scripts fanning out via npm workspaces.
  • Frontend: ESLint flat config (warn-baseline for legacy code), Vitest + jsdom + Testing Library, @/ alias in vite.config.js and jsconfig.json, 4 real tests of formatDuration.
  • Backend: ESLint flat config, node --test auto-discovery (Node 22+), supertest available for future route tests, 6 real tests of sanitizeLimit / sanitizeSort.
  • VS Code: recommended-extensions list + workspace settings (formatOnSave, fixAll.eslint on save, per-package eslint.workingDirectories).
  • CI: .github/workflows/ci.yml runs install / lint / test / build on Node 22 for every push and PR.
  • memory.md updated; new decisions log entry records warn-baseline, Node 22 floor, react-hooks v7 strategy, and the no-dupe-keys one-line exception.

Local verification

  • npm run lint (root): 0 errors, 43 warnings, exit 0
  • npm test (root): 10 tests passed (6 backend, 4 frontend), exit 0
  • npm run build (root): exit 0
  • Deliberate parse error: lint exits 1, returns to 0 when reverted.

Scope kept tight

The modified README.md, feed-mode-prd.md, CLAUDE.md, TESTING.md, and issues/011-019.md are intentionally NOT in this PR; they're a separate concern from tooling and will land in their own changes.

Follow-ups (not in this PR)

  • Two no-constant-binary-expression warnings in LightboxModal.jsx look like real logic bugs; recommend addressing during that file's shrink, not under 010.
  • 4 npm audit findings (3 moderate, 1 high) appeared post-install; deferred (would need npm audit fix --force, which is explicitly forbidden per CLAUDE.md).

🤖 Generated with Claude Code

… config

Issue 010. Stands up the static-check + test + build layer that all 011+
issues will depend on. No production code touched except a single dead
duplicate `width` key in VideoPlayer.jsx (explicit one-line exception
to the do-not-touch list, user-approved).

Root:
- .editorconfig, .prettierrc.json, .prettierignore, .gitattributes
- root package.json: rename to "nightfeed", add engines node >=22,
  add lint/test scripts that fan out to workspaces
- .github/workflows/ci.yml: Node 22, install/lint/test/build on push + PR

Frontend (nightfeed-frontend):
- eslint.config.js (flat: @eslint/js + react flat + react-hooks + jsx-runtime
  + eslint-config-prettier; warn-baseline overrides for legacy code)
- jsconfig.json, vitest.config.js, src/test/setup.js
- vite.config.js: add @ -> ./src resolve alias
- package.json: lint, lint:fix, test, test:ui scripts; new devDeps
- src/utils/format.test.js: 4 real tests of formatDuration

Backend (nightfeed-backend):
- eslint.config.js (flat: @eslint/js + Node globals + eslint-config-prettier)
- jsconfig.json
- package.json: lint, lint:fix, test (node --test auto-discovery); new devDeps
- src/utils/normalizePost.test.js: 6 real tests of sanitizeLimit + sanitizeSort

VS Code:
- .vscode/extensions.json (ESLint, Prettier, Copilot, Copilot Chat, Claude Code)
- .vscode/settings.json (formatOnSave, fixAll.eslint on save, working dirs)

memory.md: updated Current state, added 2026-05-26 decisions entry
(warn-baseline, Node 22 floor, react-hooks v7 strategy, no-dupe-keys exception).

Local verification:
- npm run lint  (root): 0 errors, 43 warnings, exit 0
- npm test       (root): 10 tests passed (6 backend, 4 frontend), exit 0
- npm run build (root): exit 0
- Deliberate parse error: lint exits 1 as expected; clean again after revert.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 26, 2026 07:58
@netlify

netlify Bot commented May 26, 2026

Copy link
Copy Markdown

Deploy Preview for nightfeed failed.

Name Link
🔨 Latest commit c372b06
🔍 Latest deploy log https://app.netlify.com/projects/nightfeed/deploys/6a1555674b275a000895e1b0

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR scaffolds the monorepo’s developer tooling so linting, testing, and builds are consistently runnable locally and in CI (issue 010), while keeping production code changes minimal.

Changes:

  • Adds workspace-level scripts and a Node 22+ engine floor to standardize lint/test/build execution.
  • Sets up ESLint (flat config) + Prettier for both frontend and backend, plus Vitest (jsdom) for frontend and node --test for backend with initial unit tests.
  • Adds VS Code workspace configuration and a GitHub Actions CI workflow to run install/lint/test/build on pushes and PRs.

Reviewed changes

Copilot reviewed 21 out of 22 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
package.json Renames package, adds Node engine floor, adds workspace lint/test scripts.
memory.md Documents project “memory”, current state, and tooling decisions for issue 010.
frontend/vitest.config.js Configures Vitest to run in jsdom with setup file and @/ alias.
frontend/vite.config.js Adds @/ path alias resolution to Vite config.
frontend/src/utils/format.test.js Adds unit tests for formatDuration.
frontend/src/test/setup.js Adds test setup importing Testing Library matchers.
frontend/src/components/VideoPlayer.jsx Removes a dead duplicate width key in inline style object.
frontend/package.json Adds lint/test scripts and devDependencies for ESLint/Prettier/Vitest/Testing Library.
frontend/jsconfig.json Adds JS path mapping for @/* and module resolution settings for editor tooling.
frontend/eslint.config.js Adds frontend ESLint flat config including react + react-hooks and Prettier integration.
backend/src/utils/normalizePost.test.js Adds backend unit tests for sanitizeLimit and sanitizeSort using node:test.
backend/package.json Adds lint/test scripts and devDependencies for ESLint + supertest.
backend/jsconfig.json Adds backend JS project config for editor tooling.
backend/eslint.config.js Adds backend ESLint flat config and Prettier integration.
.vscode/settings.json Adds workspace formatting and ESLint-on-save settings with per-package working directories.
.vscode/extensions.json Recommends ESLint/Prettier and assistant extensions for contributors.
.prettierrc.json Adds Prettier formatting configuration.
.prettierignore Ignores node_modules, dist, and package-lock from formatting.
.github/workflows/ci.yml Adds CI workflow running install/lint/test/build on Node 22.
.gitattributes Normalizes line endings to LF for text files.
.editorconfig Adds editor defaults (2-space indent, LF, trim whitespace, etc.).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread frontend/package.json
Comment on lines +33 to +36
"jsdom": "^29.1.1",
"prettier": "^3.8.3",
"vite": "^5.4.10",
"vitest": "^4.1.7"
Comment thread package.json
"frontend"
],
"engines": {
"node": ">=22"
Comment thread .github/workflows/ci.yml
cache: npm

- name: Install dependencies
run: npm install
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@astrobyte-dev astrobyte-dev merged commit 73cc264 into main May 26, 2026
2 of 6 checks passed
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.

2 participants