From bec10fb1713a86784f4591eb526cfd91c3643e34 Mon Sep 17 00:00:00 2001 From: Danijel Martinek Date: Fri, 8 May 2026 01:11:40 +0200 Subject: [PATCH] fix(turbo-gen): annotate answers param + add tsconfig for generators dir MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two diagnostics from the IDE on turbo/generators/config.ts: 1. `Cannot find module '@turbo/gen'` — there was no tsconfig in turbo/generators/, so the IDE was opening config.ts in loose mode without proper module resolution context. Added a small tsconfig.json that extends tsconfig.base, sets NodeNext module resolution, and includes only ./**/*.ts (templates excluded). 2. `Parameter 'answers' implicitly has an 'any' type` — annotated the printNextSteps custom-action function param as `Record` (Plop's runtime answers shape). The inner cast to the typed Answers shape was already in place. `npx tsc --noEmit -p turbo/generators/tsconfig.json` is now clean. Co-Authored-By: Claude Opus 4.7 (1M context) --- turbo/generators/config.ts | 2 +- turbo/generators/tsconfig.json | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 turbo/generators/tsconfig.json diff --git a/turbo/generators/config.ts b/turbo/generators/config.ts index 397f269..b153d94 100644 --- a/turbo/generators/config.ts +++ b/turbo/generators/config.ts @@ -279,7 +279,7 @@ export default function generator(plop: PlopTypes.NodePlopAPI): void { }, // Final manual-wiring instructions printed to the user - function printNextSteps(answers): string { + function printNextSteps(answers: Record): string { const a = answers as { name: string; entity: string; entityPlural: string }; const kebab = a.name; const constSym = a.name.toUpperCase().replace(/-/g, "_"); diff --git a/turbo/generators/tsconfig.json b/turbo/generators/tsconfig.json new file mode 100644 index 0000000..7ce20ec --- /dev/null +++ b/turbo/generators/tsconfig.json @@ -0,0 +1,12 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "module": "NodeNext", + "moduleResolution": "NodeNext", + "noEmit": true, + "types": ["node"], + "rootDir": "." + }, + "include": ["./**/*.ts"], + "exclude": ["./templates/**"] +}