diff --git a/package.json b/package.json index 0682974..c93f56c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@mapringg/standard", - "version": "1.3.0", + "version": "1.3.1", "description": "One oxlint config and plugin for every repository.", "license": "MIT", "repository": "github:mapringg/standard", diff --git a/src/plugin/owners.mjs b/src/plugin/owners.mjs index ad87b1c..da1645f 100644 --- a/src/plugin/owners.mjs +++ b/src/plugin/owners.mjs @@ -98,7 +98,7 @@ const TABLE = [ use: "Call models through #/lib/ai.", }, { - ban: { module: /^(?:@base-ui-components|@base-ui|@rn-primitives)\// }, + ban: { module: /^(?:@base-ui-components|@base-ui|@rn-primitives|@ui-sdk)\// }, kinds: UI, owner: ["src/components/ui/**"], use: "Use the primitives from #/components/ui.", diff --git a/test/owners.test.mjs b/test/owners.test.mjs index 6f73b15..fb61d61 100644 --- a/test/owners.test.mjs +++ b/test/owners.test.mjs @@ -89,6 +89,22 @@ test("owners bans forwardRef in every UI app", (t) => { deepEqual(filesWith(result, "owners"), ["apps/web/src/components/ui/button.tsx"]); }); +test("owners confines UI primitive packages to components/ui in UI apps", (t) => { + const result = lint(t, { + "apps/web/src/components/ui/button.tsx": 'export { Button } from "@ui-sdk/react";\n', + "apps/web/src/features/task/task-button.tsx": 'export { Button } from "@ui-sdk/react";\n', + "apps/web/src/features/task/task-dialog.tsx": 'export { Dialog } from "@base-ui-components/react/dialog";\n', + "apps/mobile/src/features/task/task-text.tsx": 'export { Text } from "@rn-primitives/slot";\n', + "apps/api/src/features/tasks/view.ts": 'export { Button } from "@ui-sdk/react";\n', + "apps/web/src/features/task/task-sdk.ts": 'export { client } from "ui-sdk";\n', + }); + deepEqual(filesWith(result, "owners"), [ + "apps/mobile/src/features/task/task-text.tsx", + "apps/web/src/features/task/task-button.tsx", + "apps/web/src/features/task/task-dialog.tsx", + ]); +}); + test("owners lets an owner file's own test use what the owner owns", (t) => { const result = lint(t, { "apps/web/src/lib/log.ts": "export const log = (message: string) => console.log(message);\n",