Skip to content

Setup

Everything on this page runs from the repository root. The frontend is not in a subdirectory.

Yarn 4 is activated through Corepack, so make sure to install it or yarn will not work:

Terminal window
npm install -g corepack --ignore-scripts
corepack enable
corepack install

Once Corepack is set up, install the dependencies:

Terminal window
yarn

CI uses yarn install --immutable --mode=skip-build, which fails rather than updating yarn.lock. If your local install modifies the lockfile, commit that change deliberately, otherwise CI will reject it.

package.json defines six scripts. There is no typecheck, no stylelint and no cypress script.

Starts the Vite dev server on http://localhost:5173 with hot module replacement. Type and lint errors are not reported here — Vite only surfaces module resolution and runtime errors, as an overlay in the browser.

Runs tsc -b && vite build and writes to build/. Because tsc runs first, this is the only command that typechecks the project. Run it before pushing; a type error that never shows up in the dev server will fail CI here.

Runs Vitest in watch mode. For a single run:

Terminal window
yarn test --run

See Testing for fixtures, render helpers and the Cypress setup.

Runs ESLint over src/. The config (eslint.config.mjs) loads eslint-plugin-only-warn, which downgrades every rule to a warning. That means yarn lint reports problems and still exits with code 0, so a passing local lint tells you nothing. CI runs:

Terminal window
yarn lint --max-warnings 0

Use that form locally too. It is the single most common cause of a first red pipeline.

Runs Prettier over src/**/*.{ts,tsx}.

Installs the Husky git hooks. Yarn runs it automatically after yarn install.

.husky/pre-commit runs lint-staged, which is configured in package.json:

Files Action
src/**/*.{ts,tsx} eslint --fix
src/**/*.{ts,tsx,json,css,scss,md} prettier --write

So your staged changes are formatted and auto-fixed on every commit. git commit --no-verify skips the hook; if you use it, run yarn format and yarn lint --max-warnings 0 yourself before pushing.

The repository root has an .editorconfig, so make sure your editor honours it (LF line endings, UTF-8, 2-space indent, trailing whitespace trimmed, final newline).

Install the ESLint and Prettier extensions, then add to .vscode/settings.json:

{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true
}

Pointing at the workspace TypeScript matters: the project is on TypeScript 6, and VS Code’s bundled version may be older.

  • Languages & Frameworks → JavaScript → Code Quality Tools → ESLint: choose Automatic ESLint configuration.
  • Prettier: enable On save, with the file pattern {**/*,*}.{ts,tsx,json,css,scss,md}.
  • Project Structure: mark src as a Resources root, otherwise the IDE will not resolve the bare imports described below even though the build does.