style(format): appliquer Prettier sur 6 fichiers du scaffold Sprint 0

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Hermann_Kitio 2026-04-17 17:56:20 +03:00
parent 7fed47dfeb
commit 720d4dbbf8
6 changed files with 11 additions and 36 deletions

View file

@ -12,10 +12,7 @@ function ScaffoldPlaceholder() {
return ( return (
<main className="p-6"> <main className="p-6">
<h1 className="text-2xl font-semibold">Expria scaffold Sprint 0</h1> <h1 className="text-2xl font-semibold">Expria scaffold Sprint 0</h1>
<p> <p>Aucune feature n'est encore branchée. Les routes seront ajoutées au fil des sprints.</p>
Aucune feature n'est encore branchée. Les routes seront ajoutées au fil
des sprints.
</p>
</main> </main>
) )
} }

View file

@ -10,12 +10,7 @@
*/ */
import { describe, it, expect } from 'vitest' import { describe, it, expect } from 'vitest'
import { import { canUserSimulate, checkFeatureAccess, getPlanPermissions, PLANS } from '../access'
canUserSimulate,
checkFeatureAccess,
getPlanPermissions,
PLANS,
} from '../access'
describe('canUserSimulate', () => { describe('canUserSimulate', () => {
// Plan FREE — dans les limites // Plan FREE — dans les limites
@ -174,7 +169,7 @@ describe('checkFeatureAccess', () => {
}) })
describe('PLANS structure', () => { describe('PLANS structure', () => {
it("les trois plans ont les mêmes clés", () => { it('les trois plans ont les mêmes clés', () => {
const freeKeys = Object.keys(PLANS.free).sort() const freeKeys = Object.keys(PLANS.free).sort()
const standardKeys = Object.keys(PLANS.standard).sort() const standardKeys = Object.keys(PLANS.standard).sort()
const premiumKeys = Object.keys(PLANS.premium).sort() const premiumKeys = Object.keys(PLANS.premium).sort()

View file

@ -63,7 +63,7 @@ describe('canSimulate (alias de canUserSimulate avec signature ergonomique)', ()
expect(result.reason).toBe('invalid_plan') expect(result.reason).toBe('invalid_plan')
}) })
it("accepte bien la signature (plan, used) avec les bons arguments", () => { it('accepte bien la signature (plan, used) avec les bons arguments', () => {
// Vérifie que l'ordre des arguments est correct // Vérifie que l'ordre des arguments est correct
// (un inversement accidentel donnerait un plan='0' ce qui bloquerait tout) // (un inversement accidentel donnerait un plan='0' ce qui bloquerait tout)
const result = canSimulate('premium', 100) const result = canSimulate('premium', 100)

View file

@ -1,4 +1,4 @@
@import "tailwindcss"; @import 'tailwindcss';
:root { :root {
--text: #6b6375; --text: #6b6375;
@ -10,8 +10,7 @@
--accent-bg: rgba(170, 59, 255, 0.1); --accent-bg: rgba(170, 59, 255, 0.1);
--accent-border: rgba(170, 59, 255, 0.5); --accent-border: rgba(170, 59, 255, 0.5);
--social-bg: rgba(244, 243, 236, 0.5); --social-bg: rgba(244, 243, 236, 0.5);
--shadow: --shadow: rgba(0, 0, 0, 0.1) 0 10px 15px -3px, rgba(0, 0, 0, 0.05) 0 4px 6px -2px;
rgba(0, 0, 0, 0.1) 0 10px 15px -3px, rgba(0, 0, 0, 0.05) 0 4px 6px -2px;
--sans: system-ui, 'Segoe UI', Roboto, sans-serif; --sans: system-ui, 'Segoe UI', Roboto, sans-serif;
--heading: system-ui, 'Segoe UI', Roboto, sans-serif; --heading: system-ui, 'Segoe UI', Roboto, sans-serif;
@ -43,8 +42,7 @@
--accent-bg: rgba(192, 132, 252, 0.15); --accent-bg: rgba(192, 132, 252, 0.15);
--accent-border: rgba(192, 132, 252, 0.5); --accent-border: rgba(192, 132, 252, 0.5);
--social-bg: rgba(47, 48, 58, 0.5); --social-bg: rgba(47, 48, 58, 0.5);
--shadow: --shadow: rgba(0, 0, 0, 0.4) 0 10px 15px -3px, rgba(0, 0, 0, 0.25) 0 4px 6px -2px;
rgba(0, 0, 0, 0.4) 0 10px 15px -3px, rgba(0, 0, 0, 0.25) 0 4px 6px -2px;
} }
#social .button-icon { #social .button-icon {

View file

@ -11,9 +11,7 @@ const envSchema = z.object({
const parsed = envSchema.safeParse(import.meta.env) const parsed = envSchema.safeParse(import.meta.env)
if (!parsed.success) { if (!parsed.success) {
const issues = parsed.error.issues const issues = parsed.error.issues.map((i) => ` - ${i.path.join('.')}: ${i.message}`).join('\n')
.map((i) => ` - ${i.path.join('.')}: ${i.message}`)
.join('\n')
throw new Error( throw new Error(
`Variables d'environnement invalides ou manquantes :\n${issues}\n\nVérifier .env.example`, `Variables d'environnement invalides ou manquantes :\n${issues}\n\nVérifier .env.example`,
) )

View file

@ -1,10 +1,5 @@
import { env } from '@/shared/config/env' import { env } from '@/shared/config/env'
import type { import type { ApiError, ClientError, FetchError, FrontendErrorCode } from '@/shared/types/api'
ApiError,
ClientError,
FetchError,
FrontendErrorCode,
} from '@/shared/types/api'
import { getAccessToken } from './auth-client' import { getAccessToken } from './auth-client'
import { logger } from './logger' import { logger } from './logger'
@ -21,10 +16,7 @@ export interface ApiFetchOptions {
retry?: { max: number; baseDelayMs: number } retry?: { max: number; baseDelayMs: number }
} }
export async function apiFetch<T>( export async function apiFetch<T>(path: string, options: ApiFetchOptions = {}): Promise<T> {
path: string,
options: ApiFetchOptions = {},
): Promise<T> {
const method = (options.method ?? 'GET').toUpperCase() const method = (options.method ?? 'GET').toUpperCase()
const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS
const retry = const retry =
@ -144,12 +136,7 @@ function isFetchError(err: unknown): err is FetchError {
async function parseApiError(response: Response): Promise<ApiError> { async function parseApiError(response: Response): Promise<ApiError> {
try { try {
const body = await response.json() const body = await response.json()
if ( if (body && typeof body === 'object' && body.error === true && typeof body.code === 'string') {
body &&
typeof body === 'object' &&
body.error === true &&
typeof body.code === 'string'
) {
return body as ApiError return body as ApiError
} }
} catch { } catch {