Closed kettanaito closed 9 months ago
Here's what I did in my workshop: https://github.com/epicweb-dev/react-fundamentals/blob/main/kcdshop/post-set-playground.js
Check docs here: https://github.com/epicweb-dev/kcdshop/blob/main/docs/other.md#set-to-playground
I want to avoid encoding a bunch of stuff about the workshops themselves into the workshop app because then we have to deal with breaking changes and supporting a million use cases. I think this is a good level of inversion of control and this should handle your use case well.
Oh, that's neat! Thanks. I may have something similar to have a great IDE experience.
The problem
We encourage the students to run the
playground
directory in their IDE but that directory never has any TypeScript configuration. This results in the default VS Code types being present but nothing else.Example: I want to type a
process
while working on an exercise. But VS Code will force-correct me toProcessingInstruction
because it doesn't know myplayground
actually relies on@types/node
.The solution
While there are a couple of ways to solve this, I find the following to be the only solution that would work for all IDEs, not just VS Code:
tsconfig.json
to every state of theplayground
directory.