Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/canonical-dnd-owner.md
Original file line number Diff line number Diff line change
@@ -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.
16 changes: 15 additions & 1 deletion src/eslint.test.ts
Original file line number Diff line number Diff line change
@@ -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 = {
Expand All @@ -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');
});
});
7 changes: 2 additions & 5 deletions src/eslint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Loading