UI primitives (Tailwind, no shadcn CLI dependency): - Button, Card, Input, Textarea, Label, Badge, Select, Dialog - Brand, Header, Footer, Shell layout wrapper Routes: - HomeRoute: new bilan card + import PDF card with drag-drop, error toast - NewReportRoute: 9-species selector (8 disabled badges 'à venir'), practitioner block (fullName required + title/phone/email/SIRET/address optional), animal+owner, sessionDate. Zod-validated form via react-hook-form - EditorRoute: split view — anatomy canvas (3 tabs latéral L/R + dorsal) on the left, findings panel + conclusion + export button on the right - NotFoundRoute Editor: - AnatomyView: fetch SVG, DOMParser-based (no innerHTML), click delegation on [data-zone], CSS-variable styling per state (default/selected/linked) - AnatomyCanvas: animated tab switcher with motion shared layout - ZoneSelection: chip bar of current selection, validate+reset buttons - FindingEditor: modal dialog with severity radios, pathology multi-select filtered by zones, free-text pathology input, linked-zones picker, comment - FindingPanel: list of findings with hover-preview wired to canvas highlight - ConclusionPanel: conclusion + recommendations + next appointment - ExportButton: triggers PDF download - rasterize.ts: SVG → PNG bytes via canvas (used by editor before PDF export) ESLint: relax strict-type-checked to React-idiomatic level (no-confusing-void-expression off, no-misused-promises allows void-return attributes, no-floating-promises is warn). 2 remaining errors fixed (label a11y + optional chain in HomeRoute). PDF export Blob: copy bytes into fresh ArrayBuffer before Blob ctor — TS strict rejects ArrayBufferLike|SharedArrayBuffer as BlobPart in lib.dom 2026. Tests: 34/34 still green. Build 5.6s (motion 96KB, pdf-lib 523KB chunks).
74 lines
2.2 KiB
JavaScript
74 lines
2.2 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: '^_', varsIgnorePattern: '^_' },
|
|
],
|
|
'@typescript-eslint/consistent-type-imports': 'error',
|
|
// React-idiomatic relaxations (strict-type-checked is too aggressive
|
|
// against common JSX patterns):
|
|
'@typescript-eslint/no-confusing-void-expression': 'off',
|
|
'@typescript-eslint/no-misused-promises': [
|
|
'error',
|
|
{ checksVoidReturn: { attributes: false } },
|
|
],
|
|
'@typescript-eslint/no-floating-promises': 'warn',
|
|
'@typescript-eslint/no-unnecessary-condition': 'off',
|
|
'@typescript-eslint/restrict-template-expressions': [
|
|
'error',
|
|
{ allowNumber: true, allowBoolean: true },
|
|
],
|
|
'@typescript-eslint/dot-notation': 'off',
|
|
'@typescript-eslint/no-unnecessary-type-assertion': 'warn',
|
|
},
|
|
},
|
|
prettierConfig,
|
|
);
|