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.
This commit is contained in:
Tom Moor authored and GitHub committed 2026-08-24 23:02:31 +00:00
1 parent f1ebc1edb0
commit ccbe2fa99b
3 files changed
+28 -26

No files matched your search

-26
View File
@@ -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."
}
]
}
]
}
}
]
}
+12
View File
@@ -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"],
+16
View File
@@ -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/*"],