- React 19 dropped global JSX namespace; stub return types removed (TS infer) - vitest 2 pulled vite 5 alongside project vite 6 → upgrade vitest to 3 (dedupes) - Add @types/node to devDeps so vite/vitest configs compile - ESLint flat config: scope strictTypeChecked to src/ + tests/, ignore config files - tsconfig.app.json: include tests/, add vitest/globals to types - vite.config.ts + vitest.config.ts: use import.meta.dirname instead of __dirname - pdf/export + pdf/import: stub returns Promise.reject so require-await rule clears - tests/unit/smoke.test.ts: keep vitest run from exiting 1 with no tests
24 lines
541 B
TypeScript
24 lines
541 B
TypeScript
import react from '@vitejs/plugin-react';
|
|
import path from 'node:path';
|
|
import { defineConfig } from 'vitest/config';
|
|
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(import.meta.dirname, 'src'),
|
|
},
|
|
},
|
|
test: {
|
|
globals: true,
|
|
environment: 'jsdom',
|
|
setupFiles: ['./tests/unit/setup.ts'],
|
|
coverage: {
|
|
provider: 'v8',
|
|
reporter: ['text', 'lcov'],
|
|
include: ['src/**/*.{ts,tsx}'],
|
|
exclude: ['src/**/*.d.ts', 'src/vite-env.d.ts'],
|
|
},
|
|
},
|
|
});
|