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.
This commit is contained in:
@@ -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 —
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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",
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user