Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Bug: blockPrettier shouldn't attempt to resolve versions of local file plugins #2120

Closed
3 tasks done
JoshuaKGoldberg opened this issue Apr 3, 2025 · 1 comment · Fixed by #2121
Closed
3 tasks done
Labels
type: bug Something isn't working :(

Comments

@JoshuaKGoldberg
Copy link
Owner

Bug Report Checklist

  • I have tried restarting my IDE and the issue persists.
  • I have pulled the latest main branch of the repository.
  • I have searched for related issues and found none that matched my issue.

Expected

blockPrettier should allow plugin paths that are local (i.e. start with .), not just dep names.

Actual

Trying to run with a CTA config containing:

blockPrettier({
	plugins: ["./lib/index.js"],
})
■  Error running create-typescript-app:
│
■  Error: './lib/index.js is neither in package.json's dependencies nor its devDependencies.
│      at getPackageDependency (file:///Users/josh/repos/prettier-plugin-curly/node_modules/.pnpm/[email protected][email protected]/node_modules/create-typescript-app/lib/data/packageData.js:17:11)
│      at file:///Users/josh/repos/prettier-plugin-curly/node_modules/.pnpm/[email protected][email protected]/node_modules/create-typescript-app/lib/data/packageData.js:10:21
│      at Array.map (<anonymous>)
│      at getPackageDependencies (file:///Users/josh/repos/prettier-plugin-curly/node_modules/.pnpm/[email protected][email protected]/node_modules/create-typescript-app/lib/data/packageData.js:9:11)
│      at Object.produce (file:///Users/josh/repos/prettier-plugin-curly/node_modules/.pnpm/[email protected][email protected]/node_modules/create-typescript-app/lib/blocks/blockPrettier.js:63:30)
│      at block.produce (file:///Users/josh/repos/prettier-plugin-curly/node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected]/node_modules/bingo-stratum/lib/creators/createBlock.js:15:32)
│      at produceBlock (file:///Users/josh/repos/prettier-plugin-curly/node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected]/node_modules/bingo-stratum/lib/producers/produceBlock.js:9:26)
│      at produceBlocks (file:///Users/josh/repos/prettier-plugin-curly/node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected]/node_modules/bingo-stratum/lib/producers/produceBlocks.js:38:35)
│      at produceStratumTemplate (file:///Users/josh/repos/prettier-plugin-curly/node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected]/node_modules/bingo-stratum/lib/producers/produceStratumTemplate.js:10:12)
│      at Object.produce (file:///Users/josh/repos/prettier-plugin-curly/node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected]/node_modules/bingo-stratum/lib/creators/createStratumTemplate.js:84:20)
│

Additional Info

Example usage in the wild: https://github.com/JoshuaKGoldberg/prettier-plugin-curly/pull/630/files#diff-5b778358ef07c9914c10021cf98855c355bb26724b4a16956a714515b556f750R17-R19

🎁

Copy link

github-actions bot commented Apr 3, 2025

🎉 This is included in version v2.24.0 🎉

The release is available on:

Cheers! 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working :(
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant