From ccbe2fa99bb03b7974eaf24d3c8b050e88a44739 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Mon, 24 Aug 2026 19:02:31 -0400 Subject: [PATCH] fix: Enforce import restrictions shadowed by nested oxlint configs (#13558) Nested .oxlintrc.json files replace the root config per-rule rather than merging, so the root's shared/** override for no-restricted-imports was dead config and the sonner restriction was not enforced anywhere. Move the restrictions into shared/.oxlintrc.json, add the prosemirror-tables entry to app/.oxlintrc.json where the same shadowing applies to .tsx files, and drop the dead root override. --- .oxlintrc.json | 26 -------------------------- app/.oxlintrc.json | 12 ++++++++++++ shared/.oxlintrc.json | 16 ++++++++++++++++ 3 files changed, 28 insertions(+), 26 deletions(-) diff --git a/.oxlintrc.json b/.oxlintrc.json index 349f3eea59..7b2243a1a5 100644 --- a/.oxlintrc.json +++ b/.oxlintrc.json @@ -125,32 +125,6 @@ "react-hooks/exhaustive-deps": "error" }, "plugins": ["eslint", "oxc", "react", "typescript", "import"] - }, - { - "files": ["shared/**/*.{js,jsx,ts,tsx}"], - "rules": { - "no-restricted-imports": [ - "error", - { - "paths": [ - { - "name": "prosemirror-tables", - "importNames": [ - "addRowBefore", - "addRowAfter", - "addColumnBefore", - "addColumnAfter" - ], - "message": "Use the wrappers from shared/editor/commands/table instead, which respect the target index and place the cursor in the inserted cell." - }, - { - "name": "sonner", - "message": "Do not import a toast library within shared; surface notifications through the onNotice callback so shared code stays decoupled from the app's toast implementation." - } - ] - } - ] - } } ] } diff --git a/app/.oxlintrc.json b/app/.oxlintrc.json index c5e7a685e1..9857c6171f 100644 --- a/app/.oxlintrc.json +++ b/app/.oxlintrc.json @@ -16,6 +16,18 @@ "no-restricted-imports": [ "error", { + "paths": [ + { + "name": "prosemirror-tables", + "importNames": [ + "addRowBefore", + "addRowAfter", + "addColumnBefore", + "addColumnAfter" + ], + "message": "Use the wrappers from shared/editor/commands/table instead, which respect the target index and place the cursor in the inserted cell." + } + ], "patterns": [ { "group": ["mime-types"], diff --git a/shared/.oxlintrc.json b/shared/.oxlintrc.json index d42a6acdf0..bab232dafa 100644 --- a/shared/.oxlintrc.json +++ b/shared/.oxlintrc.json @@ -16,6 +16,22 @@ "no-restricted-imports": [ "error", { + "paths": [ + { + "name": "prosemirror-tables", + "importNames": [ + "addRowBefore", + "addRowAfter", + "addColumnBefore", + "addColumnAfter" + ], + "message": "Use the wrappers from shared/editor/commands/table instead, which respect the target index and place the cursor in the inserted cell." + }, + { + "name": "sonner", + "message": "Do not import a toast library within shared; surface notifications through the onNotice callback so shared code stays decoupled from the app's toast implementation." + } + ], "patterns": [ { "group": ["@shared/*"],