From 73704feb1014ae911277649509d7c2d707535ff7 Mon Sep 17 00:00:00 2001 From: EthanHealy01 Date: Tue, 14 Jul 2026 12:08:31 +0100 Subject: [PATCH] chore(lint): drop blanket no-restricted-imports:off for node scripts Removing the nodeGlobs 'off' (it masked a real violation) and fixing the two imports it was hiding, so the relative-import ban applies to build tooling too: - .storybook/manager.tsx: relative editor/src import -> @core/constants/theme - .storybook/preview.tsx: relative public-asset import -> new @public/* alias (wired in main.ts viteFinal + .storybook/tsconfig paths), since no src alias covers public/. No eslint-disable / suppressions. Node globals for the nodeGlobs layer are kept. --- frontend/.storybook/main.ts | 4 ++++ frontend/.storybook/manager.tsx | 2 +- frontend/.storybook/preview.tsx | 2 +- frontend/.storybook/tsconfig.json | 3 ++- frontend/eslint.config.mjs | 5 ----- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/frontend/.storybook/main.ts b/frontend/.storybook/main.ts index 8547e9092a..be281b9ae3 100644 --- a/frontend/.storybook/main.ts +++ b/frontend/.storybook/main.ts @@ -38,6 +38,10 @@ const config: StorybookConfig = { // modules (e.g. the auth supabase client that moved into proprietary). "@proprietary": resolve(__dirname, "../editor/src/proprietary"), "@core": resolve(__dirname, "../editor/src/core"), + // Public assets (e.g. the en-US translation TOML loaded ?raw by preview.tsx). + // No src alias covers public/, so this lets the config use an alias rather + // than a relative path. + "@public": resolve(__dirname, "../editor/public"), }; // Editor stories import via @app/* (proprietary→core fallback), @core/* and // @proprietary/*. Resolve them exactly the way the editor's own build does — diff --git a/frontend/.storybook/manager.tsx b/frontend/.storybook/manager.tsx index 663e629047..4f6b515203 100644 --- a/frontend/.storybook/manager.tsx +++ b/frontend/.storybook/manager.tsx @@ -11,7 +11,7 @@ import { IconButton, WithTooltip } from "storybook/internal/components"; import { THEME_ACCENT_PRESETS as PRESETS, DEFAULT_ACCENT_COLOR, -} from "../editor/src/core/constants/theme"; +} from "@core/constants/theme"; function AccentPicker() { const [globals, updateGlobals] = useGlobals(); diff --git a/frontend/.storybook/preview.tsx b/frontend/.storybook/preview.tsx index 2506f59dff..0c2805ee33 100644 --- a/frontend/.storybook/preview.tsx +++ b/frontend/.storybook/preview.tsx @@ -26,7 +26,7 @@ import { initReactI18next } from "react-i18next"; import { parse as parseToml } from "smol-toml"; // Load the real English copy so stories render human text, not raw keys. Bundled // synchronously via ?raw so it's present on the very first render (no async flash). -import enTranslationToml from "../editor/public/locales/en-US/translation.toml?raw"; +import enTranslationToml from "@public/locales/en-US/translation.toml?raw"; import "@mantine/core/styles.css"; import "@core/tokens/tokens.css"; diff --git a/frontend/.storybook/tsconfig.json b/frontend/.storybook/tsconfig.json index 9615d34a22..cb3f958b2a 100644 --- a/frontend/.storybook/tsconfig.json +++ b/frontend/.storybook/tsconfig.json @@ -12,7 +12,8 @@ ], "@core/*": ["../editor/src/core/*"], "@proprietary/*": ["../editor/src/proprietary/*"], - "@portal/*": ["../editor/src/portal/*"] + "@portal/*": ["../editor/src/portal/*"], + "@public/*": ["../editor/public/*"] }, "resolveJsonModule": true, "esModuleInterop": true, diff --git a/frontend/eslint.config.mjs b/frontend/eslint.config.mjs index 6a65e970d9..9793c60ac8 100644 --- a/frontend/eslint.config.mjs +++ b/frontend/eslint.config.mjs @@ -323,10 +323,5 @@ export default defineConfig( ...globals.node, }, }, - rules: { - // Standalone node scripts have no bundler, so workspace aliases (@app/*) - // don't resolve — relative imports are correct here. - "no-restricted-imports": "off", - }, }, );