Files
siop2/eslint.config.mjs
pr-daaif 36de93bb7e test(r0.12): ESLint monorepo + parcours démo Playwright — R0.12 clos
- ESLint 10 flat config racine (typescript-eslint, react-hooks) ; règle
  ADR-001 codée : no-restricted-imports interdit « minio » partout sauf
  minio-storage.service.ts (violation vérifiée) ; jobs lint par paquet
- Playwright apps/web/e2e : redirection sans jeton, connexion démo 1 clic,
  coquille (rail actif, chip DÉMO), bascule de rôle chronométrée < 3 s
  (ADR-002), /design, déconnexion avec purge ; webServer api dist + vite,
  seed idempotent en globalSetup, PW_CHANNEL=chrome en local
- CI : jobs lint + e2e (services PostgreSQL/Redis, artefact
  playwright-report sur échec) ; vitest restreint à src/

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-15 22:36:17 +01:00

57 lines
1.5 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// ESLint (R0.12) — config unique du monorepo (flat config, ESLint 9).
// Porte notamment la règle d'architecture ADR-001 : le SDK MinIO ne
// s'importe QUE dans l'implémentation de FileStorage.
import eslint from '@eslint/js';
import reactHooks from 'eslint-plugin-react-hooks';
import tseslint from 'typescript-eslint';
export default tseslint.config(
{
ignores: [
'**/dist/**',
'**/node_modules/**',
'**/*.d.ts',
'**/coverage/**',
'docs/**',
'**/*.config.{js,mjs,ts}',
'apps/api/jest.config.js',
],
},
eslint.configs.recommended,
...tseslint.configs.recommended,
{
rules: {
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
],
// ADR-001 : MinIO derrière l'interface FileStorage, jamais en direct
'no-restricted-imports': [
'error',
{
paths: [
{
name: 'minio',
message:
'Import direct du SDK MinIO interdit (ADR-001) : passez par linterface FileStorage (apps/api/src/files).',
},
],
},
],
},
},
{
// Seul fichier autorisé : l'implémentation MinIO de FileStorage
files: ['apps/api/src/files/minio-storage.service.ts'],
rules: { 'no-restricted-imports': 'off' },
},
{
files: ['apps/web/**/*.{ts,tsx}'],
plugins: { 'react-hooks': reactHooks },
rules: {
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'error',
},
},
);