- 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
56 lines
1.5 KiB
JavaScript
56 lines
1.5 KiB
JavaScript
import js from '@eslint/js';
|
|
import importX from 'eslint-plugin-import-x';
|
|
import jsxA11y from 'eslint-plugin-jsx-a11y';
|
|
import reactHooks from 'eslint-plugin-react-hooks';
|
|
import prettierConfig from 'eslint-config-prettier';
|
|
import tseslint from 'typescript-eslint';
|
|
|
|
export default tseslint.config(
|
|
{
|
|
ignores: [
|
|
'dist/',
|
|
'node_modules/',
|
|
'coverage/',
|
|
'playwright-report/',
|
|
'test-results/',
|
|
'eslint.config.js',
|
|
'vite.config.ts',
|
|
'vitest.config.ts',
|
|
'playwright.config.ts',
|
|
'tailwind.config.ts',
|
|
],
|
|
},
|
|
js.configs.recommended,
|
|
...tseslint.configs.strictTypeChecked,
|
|
...tseslint.configs.stylisticTypeChecked,
|
|
{
|
|
files: ['src/**/*.{ts,tsx}', 'tests/**/*.{ts,tsx}'],
|
|
languageOptions: {
|
|
parserOptions: {
|
|
project: ['./tsconfig.app.json'],
|
|
tsconfigRootDir: import.meta.dirname,
|
|
},
|
|
},
|
|
plugins: {
|
|
'react-hooks': reactHooks,
|
|
'jsx-a11y': jsxA11y,
|
|
'import-x': importX,
|
|
},
|
|
rules: {
|
|
...reactHooks.configs.recommended.rules,
|
|
...jsxA11y.configs.recommended.rules,
|
|
'import-x/order': [
|
|
'warn',
|
|
{
|
|
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
|
|
'newlines-between': 'always',
|
|
alphabetize: { order: 'asc' },
|
|
},
|
|
],
|
|
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
|
|
'@typescript-eslint/consistent-type-imports': 'error',
|
|
},
|
|
},
|
|
prettierConfig,
|
|
);
|