plan/react-rewrite #1

Merged
gnezim merged 138 commits from plan/react-rewrite into main 2026-04-15 12:21:16 +03:00
Showing only changes of commit e9640b17fd - Show all commits
+77
View File
@@ -106,4 +106,81 @@ export default [
],
},
},
// --- Restricted imports (master plan §1A-3) ---
// OTel SDK internals: only src/observability/metrics/otel.ts may import them
{
files: ["src/**/*.{ts,tsx}"],
ignores: ["src/observability/metrics/otel.ts"],
rules: {
"no-restricted-imports": [
"error",
{
paths: [
{
name: "@opentelemetry/sdk-metrics",
message: "Import from @opentelemetry/api or use getMeter() from @/observability/metrics/otel instead. Direct SDK access is restricted to src/observability/metrics/otel.ts.",
},
{
name: "@opentelemetry/sdk-node",
message: "Import from @opentelemetry/api or use getMeter()/getTracer() from @/observability/metrics/otel instead. Direct SDK access is restricted to src/observability/metrics/otel.ts.",
},
],
},
],
},
},
// react-i18next: only src/i18n/provider.tsx may import it
{
files: ["src/**/*.{ts,tsx}"],
ignores: ["src/i18n/provider.tsx"],
rules: {
"no-restricted-imports": [
"error",
{
paths: [
{
name: "react-i18next",
message: "Import useTranslation from @/i18n/provider instead. Direct react-i18next imports are restricted to src/i18n/provider.tsx.",
},
],
},
],
},
},
// @microsoft/signalr: forbidden in files that run during SSR.
// SSR-bundle = routes/ and server/ directories. Features + shared/hooks are client-side.
{
files: ["src/routes/**/*.{ts,tsx}", "src/server/**/*.{ts,tsx}"],
rules: {
"no-restricted-imports": [
"error",
{
paths: [
{
name: "@microsoft/signalr",
message: "SignalR must not be imported in SSR-bundle files (routes/, server/). Use dynamic import in a useEffect or a client-only wrapper.",
},
],
},
],
},
},
// window.localStorage / window.sessionStorage: only src/shared/storage.ts
{
files: ["src/**/*.{ts,tsx}"],
ignores: ["src/shared/storage.ts"],
rules: {
"no-restricted-globals": [
"error",
{
name: "localStorage",
message: "Use the storage module from @/shared/storage instead. Direct localStorage access is restricted to src/shared/storage.ts.",
},
{
name: "sessionStorage",
message: "Use the storage module from @/shared/storage instead. Direct sessionStorage access is restricted to src/shared/storage.ts.",
},
],
},
},
];