Skip to content

fix: don't rely on npm hoisting for Prettier and TypeScript configs - #289

Merged
zachfedor merged 3 commits into
stellar-scaffold:mainfrom
ElliotFriend:fix/template-npm-hoisting
Nov 3, 2026
Merged

zachfedor merged 3 commits into
stellar-scaffold:mainfrom
ElliotFriend:fix/template-npm-hoisting

Conversation

@ElliotFriend

Copy link
Copy Markdown
Contributor

What

A few configs only worked because npm hoists packages to the root node_modules. Under pnpm (or any non-hoisting layout) they fail:

  • The root "prettier" field uses @theahaco/ts-config/prettier, but the root doesn't declare @theahaco/ts-config, so format / format:check fail with Cannot find package '@theahaco/ts-config'.
  • app-lib/tsconfig.json extends @theahaco/ts-config/typescript.app without declaring it.
  • templates/svelte/prettier.config.mjs names prettier-plugin-svelte as a string. Prettier resolves plugin strings from its working directory, so formatting from the root fails unless the plugin is hoisted. Importing it resolves from the template instead.

Changes

  • Declare @theahaco/ts-config (^1.3.0, matching the templates) in the root and app-lib
  • Import the Svelte Prettier plugin rather than naming it

The lockfile change is just the two new declarations; @theahaco/ts-config was already locked through the templates.

Testing

  • npm run format:check and npm run lint pass
  • scripts/check-dep-parity.mjs reports no drift
  • npm ci (npm 10.9.4) accepts the updated lockfile without changes

Note

Running npm install on main currently prunes ~180 lines of random/stale lockfile entries. I left that out of this PR, since it's not my lockfile to do anything drastic with.

The root Prettier config uses it but only resolved through npm hoisting.
A plugin name string resolves from Prettier's working directory, so
formatting from the root only worked when npm hoisted the plugin.
@zachfedor
zachfedor merged commit 55e18b7 into stellar-scaffold:main Nov 3, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants