diff --git a/rsconcept/frontend/eslint.config.js b/rsconcept/frontend/eslint.config.js index 7f38cb2f..c5229e22 100644 --- a/rsconcept/frontend/eslint.config.js +++ b/rsconcept/frontend/eslint.config.js @@ -72,7 +72,6 @@ export default [ settings: { react: { version: 'detect' } }, rules: { ...basicRules, - 'react-refresh/only-export-components': ['off', { allowConstantExport: true }], 'simple-import-sort/imports': [ 'warn', { diff --git a/rsconcept/frontend/src/app/global-providers.tsx b/rsconcept/frontend/src/app/global-providers.tsx index fa1c3d29..9b6c92f3 100644 --- a/rsconcept/frontend/src/app/global-providers.tsx +++ b/rsconcept/frontend/src/app/global-providers.tsx @@ -10,7 +10,7 @@ export function GlobalProviders({ children }: React.PropsWithChildren) { - + {import.meta.env.DEV ? : null} {children} diff --git a/rsconcept/frontend/src/components/info-error.tsx b/rsconcept/frontend/src/components/info-error.tsx index 3aaf8d48..7d893050 100644 --- a/rsconcept/frontend/src/components/info-error.tsx +++ b/rsconcept/frontend/src/components/info-error.tsx @@ -70,7 +70,9 @@ export function DescribeError({ error }: { error: ErrorData }) { let sanitizedHtml: string | null = null; if (isHtml) { sanitizedHtml = DOMPurify.sanitize(error.response.data as string, { - USE_PROFILES: { html: true } + USE_PROFILES: { html: true }, + ALLOWED_TAGS: ['b', 'i', 'em', 'strong', 'ul', 'li', 'br'], + ALLOWED_ATTR: [] }); } return ( diff --git a/rsconcept/frontend/src/main.tsx b/rsconcept/frontend/src/main.tsx index 8d0ec5b0..e3212551 100644 --- a/rsconcept/frontend/src/main.tsx +++ b/rsconcept/frontend/src/main.tsx @@ -5,7 +5,7 @@ import { App } from './app'; import './index.css'; -if (typeof window !== 'undefined' && !!process.env.NODE_ENV && process.env.NODE_ENV === 'development') { +if (typeof window !== 'undefined' && import.meta.env.DEV) { void import('react-scan').then(module => module.scan({ enabled: true @@ -13,17 +13,19 @@ if (typeof window !== 'undefined' && !!process.env.NODE_ENV && process.env.NODE_ ); } -window.addEventListener('error', (event: ErrorEvent) => { - const error = event.error as Error; - if ( - error instanceof Error && - typeof error.message === 'string' && - error.message.includes('Failed to fetch dynamically imported module') - ) { - console.warn('Detected stale bundle — reloading...'); - window.location.reload(); - } -}); +if (typeof window !== 'undefined') { + window.addEventListener('error', (event: ErrorEvent) => { + const error = event.error as Error; + if ( + error instanceof Error && + typeof error.message === 'string' && + error.message.includes('Failed to fetch dynamically imported module') + ) { + console.warn('Detected stale bundle — reloading...'); + window.location.reload(); + } + }); +} createRoot(document.getElementById('root')!).render(