From 302b0b860c19c05763871253b9284271cda92ea2 Mon Sep 17 00:00:00 2001 From: Danijel Martinek Date: Fri, 8 May 2026 09:39:54 +0200 Subject: [PATCH] fix(turbo-gen): add local eslint config + package.json for generators dir MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The IDE was reporting eslint errors on turbo/generators/config.ts and on the generated package because there's no eslint config at the repo root — when eslint walks up from turbo/generators/, it never finds one. The CLI didn't surface this (eslint silently exited fine on files it couldn't config), but the IDE eslint daemon did. - turbo/generators/eslint.config.js extends @repo/core-eslint/base and ignores templates/** (the .hbs partials contain {{...}} placeholders that aren't valid TS — never lint them). - turbo/generators/package.json declares "type": "module" so Node doesn't warn about CJS-vs-ESM ambiguity when loading the eslint config. Verified end-to-end: - `npx eslint . -p tsconfig.json` clean in turbo/generators/. - `pnpm turbo gen feature --args widgets Widget widgets` → pnpm install → @repo/widgets passes lint, typecheck, and 25/25 tests across 9 files. - packages/widgets cleaned up before commit; not checked in. Co-Authored-By: Claude Opus 4.7 (1M context) --- turbo/generators/eslint.config.js | 13 +++++++++++++ turbo/generators/package.json | 6 ++++++ 2 files changed, 19 insertions(+) create mode 100644 turbo/generators/eslint.config.js create mode 100644 turbo/generators/package.json diff --git a/turbo/generators/eslint.config.js b/turbo/generators/eslint.config.js new file mode 100644 index 0000000..5ca5fc6 --- /dev/null +++ b/turbo/generators/eslint.config.js @@ -0,0 +1,13 @@ +import baseConfig from "@repo/core-eslint/base"; + +export default [ + ...baseConfig, + { + // Templates are Handlebars partials emitted by the generator. They + // contain {{...}} placeholders that aren't valid TypeScript on their + // own, so they MUST NOT be linted as TS. The .hbs extension also + // already isn't picked up by eslint by default — this is belt-and- + // suspenders for IDE eslint daemons that scan by directory. + ignores: ["templates/**"], + }, +]; diff --git a/turbo/generators/package.json b/turbo/generators/package.json new file mode 100644 index 0000000..9b4bb97 --- /dev/null +++ b/turbo/generators/package.json @@ -0,0 +1,6 @@ +{ + "name": "@repo/turbo-generators", + "private": true, + "version": "0.0.0", + "type": "module" +}