diff --git a/.changeset/canonical-dnd-owner.md b/.changeset/canonical-dnd-owner.md new file mode 100644 index 0000000..a2b05e9 --- /dev/null +++ b/.changeset/canonical-dnd-owner.md @@ -0,0 +1,5 @@ +--- +'@ankhorage/devtools': patch +--- + +Allow direct imports from `@ankhorage/react-native-reanimated-dnd-web`, keep the upstream native package restricted, and remove the retired `@ankh/dnd` recommendation. diff --git a/src/eslint.test.ts b/src/eslint.test.ts index 94de16a..6a07e3c 100644 --- a/src/eslint.test.ts +++ b/src/eslint.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'bun:test'; -import { createConfig } from './eslint.js'; +import { createConfig, defaultRestrictedImports } from './eslint.js'; describe('createConfig sanity check', () => { const baseOptions = { @@ -14,4 +14,18 @@ describe('createConfig sanity check', () => { expect(Array.isArray(config)).toBe(true); expect(config.length).toBeGreaterThan(0); }); + + it('allows the owning Studio DnD package and rejects only the upstream package', () => { + expect(defaultRestrictedImports).toEqual([ + { + name: 'react-native-reanimated-dnd', + message: + "Forbidden in Ankhorage packages. Use '@ankhorage/react-native-reanimated-dnd-web' directly.", + }, + ]); + + const serializedRules = JSON.stringify(defaultRestrictedImports); + expect(serializedRules).toContain('@ankhorage/react-native-reanimated-dnd-web'); + expect(serializedRules).not.toContain('@ankh/dnd'); + }); }); diff --git a/src/eslint.ts b/src/eslint.ts index ca792ff..f8c98be 100644 --- a/src/eslint.ts +++ b/src/eslint.ts @@ -24,11 +24,8 @@ export const defaultIgnores = [ export const defaultRestrictedImports = [ { name: 'react-native-reanimated-dnd', - message: "Forbidden in monorepo. Use '@ankh/dnd' (boundary) instead.", - }, - { - name: '@ankhorage/react-native-reanimated-dnd-web', - message: "Forbidden in monorepo. Use '@ankh/dnd' (boundary) instead.", + message: + "Forbidden in Ankhorage packages. Use '@ankhorage/react-native-reanimated-dnd-web' directly.", }, ] as const;