import { defineConfig, type OxlintGlobals } from "oxlint"; // Glob for all editor app source, and the two layers that need their own // import scope. `no-restricted-imports` is repeated per scope on purpose: // oxlint REPLACES (does not merge) a rule across matching overrides, so each // scope must restate the full set of bans that apply to it. const APP_SOURCE = "editor/src/**/*.{js,mjs,jsx,ts,tsx}"; const DESKTOP_SOURCE = "editor/src/desktop/**/*.{js,mjs,jsx,ts,tsx}"; const CLOUD_SOURCE = "editor/src/cloud/**/*.{js,mjs,jsx,ts,tsx}"; // Shared import-ban building blocks ----------------------------------------- const aliasOverRelative = { regex: "^\\.", message: "Use a workspace alias (@app/* for editor, @portal/* for portal) instead of relative imports.", }; const aliasOverSrc = { regex: "^src/", message: "Use a workspace alias instead of absolute src/ imports.", }; const noTauriOutsideDesktop = { regex: "^@tauri-apps/", message: "Tauri APIs are desktop-only. Review frontend/editor/DeveloperGuide.md for structure advice.", }; const cloudNoTauri = { regex: "^@tauri-apps/", message: "cloud/ must stay platform-portable. Tauri APIs are desktop-only — reach native features via an @app/* seam (e.g. @app/platform/openExternal).", }; const cloudNoSupabase = { regex: "^@supabase/", message: "cloud/ must stay platform-portable. Reach Supabase via an @app/* seam (e.g. @app/auth/supabase, @app/auth/session) provided per-platform in saas/ and desktop/.", }; // Shared-DS Button/SegmentedControl/Chip family must come from @app/ui, not // Mantine. (The raw-