From 6bc061b0ff5507a0053c2e7e1a14a592e4b81b4b Mon Sep 17 00:00:00 2001 From: aramissennyeydd Date: Tue, 18 Jun 2024 23:22:11 -0400 Subject: [PATCH] skip react in type dep check Signed-off-by: aramissennyeydd --- packages/repo-tools/src/commands/type-deps/type-deps.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/repo-tools/src/commands/type-deps/type-deps.ts b/packages/repo-tools/src/commands/type-deps/type-deps.ts index 7b75ac37ee..877228a238 100644 --- a/packages/repo-tools/src/commands/type-deps/type-deps.ts +++ b/packages/repo-tools/src/commands/type-deps/type-deps.ts @@ -202,6 +202,14 @@ function findTypeDepErrors(typeDeps: string[], pkg: Package) { } for (const dep of deps) { + // Allow implicit declarations of these dependencies. For some packages, they may + // not be declared as a `reference types="..."` or `import ... from '@types/...' + // in the declaration file. + // Example being app-visualizer, it exports a plugin which comes from `@backstage/frontend-plugin-api`, + // the react types come from that package, but are not explicitly declared in the declaration file. + if (['@types/react'].includes(dep)) { + continue; + } errors.push( mkErr('WrongDepError', `Should be dev dep ${dep}`, { dep,