epicweb-dev / epicshop

The workshop app for all workshops on EpicWeb.dev
https://www.epicweb.dev
Other
205 stars 33 forks source link

Playground mode lacks any IntelliSense #182

Closed kettanaito closed 9 months ago

kettanaito commented 9 months ago

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 to ProcessingInstruction because it doesn't know my playground 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:

kentcdodds commented 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.

kettanaito commented 9 months ago

Oh, that's neat! Thanks. I may have something similar to have a great IDE experience.