Repository navigation
fix: don't rely on npm hoisting for Prettier and TypeScript configs - #289
Merged
zachfedor merged 3 commits intoNov 3, 2026
Merged
Conversation
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
approved these changes
Nov 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A few configs only worked because npm hoists packages to the root
node_modules. Under pnpm (or any non-hoisting layout) they fail:"prettier"field uses@theahaco/ts-config/prettier, but the root doesn't declare@theahaco/ts-config, soformat/format:checkfail withCannot find package '@theahaco/ts-config'.app-lib/tsconfig.jsonextends@theahaco/ts-config/typescript.appwithout declaring it.templates/svelte/prettier.config.mjsnamesprettier-plugin-svelteas 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
@theahaco/ts-config(^1.3.0, matching the templates) in the root andapp-libThe lockfile change is just the two new declarations;
@theahaco/ts-configwas already locked through the templates.Testing
npm run format:checkandnpm run lintpassscripts/check-dep-parity.mjsreports no driftnpm ci(npm 10.9.4) accepts the updated lockfile without changesNote
Running
npm installonmaincurrently 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.