Skip to content

Web: add ESLint and component test infrastructure (jsdom + testing-library); cover barcodeScanner and exportCsv #41

Open

Description

@falbany

The web app has vitest but effectively no safety net:

  • No ESLint — no config and no lint script anywhere in web/. That's why hook-dependency bugs (dep-less effect at FileListTable.tsx:370-377; missing browse dep at LoadConfigModal.tsx:55) were never flagged. Add eslint + typescript-eslint + eslint-plugin-react-hooks with a lint script, and wire it into pre-commit alongside ruff.
  • No component tests — vitest.config.ts runs in the default node env; no jsdom, no @testing-library/react in devDependencies. All 23 components and the 1572-line App.tsx (scan races, global keyboard handler, barcode flow, drag state) are untested. Existing tests cover only pure modules (client, configDrop, fileProperties, searchSyntax, theme, barcodeDecoder).
  • Untested pure logic that's trivially testable: utils/barcodeScanner.ts (parseBarcodeInput — the whole barcode key=value language incl. alias normalization and boolean parsing) and utils/exportCsv.ts (RFC 4180 quoting).
  • Document npm test in web/README.md (it documents build/dev only).

Suggested order: ESLint + fix its findings → jsdom/testing-library with one modal + one App keyboard test as the pattern → the two pure-logic test files.

Activity

  1. added
    enhancement
    code-quality
    frontend
    on Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    code-qualityenhancementfrontend

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions