Issue 001: Test and lint foundation#2
Merged
Conversation
Resolves the open stack/scope decisions from the planning conversation: - Issue 005 status set: active | accepted | declined | expired - Issue 008: stay on Vite, ship the AI route as a Vercel Function at /api/chat (no Next.js migration for v2) - Stack Decision section rewritten to reflect the resolved direction - Non-Goals: TypeScript migration explicitly deferred (revisit at Issue 006 if the negotiation context grows past ~5 fields) - Deployment Plan: previews are password-gated; public-traffic hardening (rate limit, spend cap, abuse logging) is a separate post-launch issue before cutover Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Closes #1. - eslint.config.js: ESLint 10 flat config (js.recommended + react-hooks + react-refresh on .jsx). caughtErrors: 'none' so the existing CopyButton catch param doesn't trip --max-warnings 0. - package.json: drop the invalid --ext flag from the lint script (flat config infers files from config). Add `test` script (`vitest run`). - vite.config.js: add `test` field for Vitest with environment: 'node' and src/**/*.test.{js,jsx} include glob. - src/utils/messageGenerator.test.js: 8 tests covering offer classification (lowball/counter/close/acceptable/accept) and counter-offer math (no-minimum vs. minimum-floor), exercising the public generateMessages export with Math.random pinned for determinism. - .github/workflows/ci.yml: add Lint and Test steps before Build. Local verification on Node 24.14 / npm 11.9: - npm run lint: 0 errors, 0 warnings - npm test: 8/8 passed - npm run build: dist/ produced Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Closes #1.
What's in this PR
Two commits:
Update HAGGLY_V2_AGENT_PLAN.md with v2 decisions— locks in decisions made during the planning conversation (Issue 005 status set, Issue 008 stack, Vite-stays, TS deferred, password-gated previews).Issue 001: add ESLint flat config, Vitest, and CI lint/test steps— the test/lint foundation itself.Issue 001 changes
eslint.config.js: ESLint 10 flat config coveringjs.configs.recommended+react-hooks+react-refresh(the JSX-only block applies React rules just to.jsx).caughtErrors: 'none'keeps--max-warnings 0viable against the existing untouched source.package.json: drops the invalid--extflag from the lint script (flat config infers from config) and addstest(vitest run).vite.config.js: adds Vitest'stestfield (environment: 'node',src/**/*.test.{js,jsx}include).src/utils/messageGenerator.test.js: 8 tests covering offer classification (lowball/counter/close/acceptable/accept) and counter-offer math (no-minimum vs. minimum-floor). Exercises the publicgenerateMessagesexport withMath.randompinned viavi.spyOnfor deterministic template selection..github/workflows/ci.yml: adds Lint and Test steps before Build.Owned-files compliance
This PR only touched files declared as owned by Issue 001 plus the planning doc commit (which is documentation, not implementation). Source files (
src/App.jsx,src/components/*,src/utils/messageGenerator.js) are untouched.Local verification
Node 24.14.0, npm 11.9.0:
npm run lint— 0 errors, 0 warningsnpm test— 8/8 passednpm run build—dist/produced (163 KB JS / 21 KB CSS)Acceptance criteria
npm run lintpassesnpm testpassesnpm run buildpassesFollow-ups deferred to later issues
messageGeneratorinternals (getOfferType,getCounterOfferexported and tested directly) → Issue 006..claude/is untracked locally — leaving.gitignorealone here since it's not in Issue 001's owned files; can be a small follow-up.