gts
gts copied to clipboard
Add support for Yarn PNP
There's a couple spots that need patches:
- Generated configs (
extends: ./node_modules/gts, etc) execacalls tonode ./node_modules/*
Implementation thoughts:
- Check for
.yarn? Hacky. - ESLint API? Probably a better idea. More work.
This would be really nice, probably the only thing preventing me from using yarn pnp.
made a very hacky bash script to setup a new project using gts and yarn pnp https://gist.github.com/xpyxel/69adecbf2661eca104cdd49fd8ba1af1
you can setup a new project with curl -sL https://git.io/JtIw7 | bash -s <editor sdk here>
most things seem to be working except for eslint-plugin-node from what it looks like
After doing some more research on the matter I'm going to attempt to get eslint-plugin-node working with the script, no promises that it will work, but if it does, gts will be "fully working" in a sense.
So the issue with the eslint plugins and other things is that due to how yarn's pnp works, they have to be under dependencies of the root project, i.e the project you're making that depends on gts, otherwise since your extending their configuration(s), it won't be able to access them currently.
Decided to go all out and made a template repo that sets up mostly everything for you, just need to run a few commands and you have a fully setup yarn + gts env. https://github.com/xpyxel/gts-pnp
was this issue ever resolved? trying to set up gts in my pnp project and getting the following error:
1 $ yarn lint
version: 16
/Users/jaismith/Developer/doc/trailhead/.pnp.cjs:33932
throw firstError;
^
Error: Qualified path resolution failed - none of those files can be found on the disk.
Source path: /Users/jaismith/Developer/doc/trailhead/node_modules/eslint/bin/eslint
Not found: /Users/jaismith/Developer/doc/trailhead/node_modules/eslint/bin/eslint
Not found: /Users/jaismith/Developer/doc/trailhead/node_modules/eslint/bin/eslint.js
Not found: /Users/jaismith/Developer/doc/trailhead/node_modules/eslint/bin/eslint.json
Not found: /Users/jaismith/Developer/doc/trailhead/node_modules/eslint/bin/eslint.node
at Function.external_module_.Module._resolveFilename (/Users/jaismith/Developer/doc/trailhead/.pnp.cjs:33931:55)
at Function.external_module_.Module._load (/Users/jaismith/Developer/doc/trailhead/.pnp.cjs:33730:48)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)
at node:internal/main/run_main_module:17:47
@jaismith i ended up just making my own thing similar: https://github.com/stacknine/ts-pnp