managarten/eslint.config.mjs
Till JS 4b8defcc4a chore(ci): add v8 test coverage tracking (non-blocking baseline)
CI previously ran `pnpm run test || true` — test failures were silently
swallowed with no artifact, so we had no visibility into what was actually
passing across 1,296 test files.

- New `test:coverage` turbo pipeline task + root script; packages that opt
  in by declaring their own `test:coverage` get picked up automatically.
- Wired up three high-value Vitest targets: apps/mana/apps/web (main
  frontend, ~590 tests), shared-ui (Svelte component library), and
  shared-storage (S3 client). Each emits lcov.info + coverage-summary.json
  + browsable HTML.
- apps/mana/apps/web `"test"` was running in watch mode (just `vitest`),
  which hangs under turbo orchestration — changed to `vitest run` and
  added `test:watch` for the interactive case.
- CI uploads coverage artifacts (14-day retention) regardless of whether
  tests passed. `continue-on-error: true` replaces `|| true` so a failed
  suite shows up as a warning annotation on the PR rather than being
  invisible. Flip to a hard gate once main is green for a full week.
- Testing guideline documents the pattern + the template vitest config
  + the planned 80% threshold.
- ESLint flat-config `vitest.config.ts` ignore only matched at the root;
  widened to `**/vitest.config.{ts,js,mjs}` so nested configs don't trip
  the project-service parser.

Coverage baseline produced locally:
  shared-storage:  91.37% lines (6 files, 123 tests)
  shared-ui:        2.87% lines (mostly Svelte components, untested)
  apps/mana/web:    9/59 test files fail — pre-existing, not regression

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 19:21:14 +02:00

73 lines
1.8 KiB
JavaScript

// @ts-check
/**
* Root ESLint configuration for Mana monorepo
*
* Uses @mana/eslint-config for unified linting across all packages.
* Apps can use their own eslint.config.* to add framework-specific rules.
*
* Config hierarchy:
* 1. Root: base + typescript + prettier (this file)
* 2. SvelteKit: adds svelteConfig
* 3. Expo Mobile: adds reactConfig
* 4. NestJS Backend: adds nestjsConfig
*/
import { baseConfig, typescriptConfig, prettierConfig } from '@mana/eslint-config';
export default [
// ============================================
// Global ignores
// ============================================
{
ignores: [
// Build outputs
'**/node_modules/**',
'**/dist/**',
'**/build/**',
'**/coverage/**',
'**/.turbo/**',
// Framework-specific
'**/.svelte-kit/**',
'**/.expo/**',
'**/.next/**',
// Archived projects
'**/apps-archived/**',
// Generated files
'**/*.d.ts',
'**/generated/**',
// Config files (tool-specific, not part of app code)
'**/drizzle.config.ts',
'playwright.config.ts',
'**/vitest.config.{ts,js,mjs}',
'tests/**',
// Documentation examples
'docs/test-examples/**',
// Games with specific runtime environments
'games/whopixels/**',
// Apps with their own ESLint configs (framework-specific)
// These import from @mana/eslint-config but add framework rules
'apps/*/apps/mobile/**',
'apps/*/apps/web/**',
'apps/*/apps/backend/**',
'apps/*/apps/audio-backend/**',
'apps/*/apps/landing/**',
'apps/*/packages/**', // Project-specific packages
'games/*/apps/**',
'games/*/packages/**', // Game-specific packages
'services/**',
],
},
// ============================================
// Base configuration for all files
// ============================================
...baseConfig,
...typescriptConfig,
...prettierConfig,
];