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

Fix a few TypeScript issues #42

Closed
4 tasks
thesoftwarephilosopher opened this issue Nov 5, 2021 · 3 comments
Closed
4 tasks

Fix a few TypeScript issues #42

thesoftwarephilosopher opened this issue Nov 5, 2021 · 3 comments
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed icebox Do eventually

Comments

@thesoftwarephilosopher
Copy link
Contributor

thesoftwarephilosopher commented Nov 5, 2021

  • If a file has no exports, everything in it is inexplicably exported as global and accessible in any other file, though using these exported values at runtime of course causes a crash. I'm sure it's just some silly tsconfig setting that I can't find. Not a huge deal but should be fixed eventually. Googled it for 10 mins and can't figure it out, maybe someone knows off-hand.

  • Would be nice to move to a testing framework that does compilation for us, so we don't have to run npm run watch while writing and solving unit tests. Local dev uses ts-node internally (via NPM scripts), and Dockerfile compiles for us. Tests are the only thing that need manual compiling. Jest has ts-jest but that also type-checks and IIRC has some issues. Mocha looks like a good candidate to convert our unit tests to.

  • Is it possible to get VS Code to see all changes in all files without having to do the npm-watch VS Code task? It'd be nice to not have to run that in the background every time we do dev. A short googling was inconclusive but didn't look promising.

  • After TypeScript 4.5 lands, I think we'll be able to remove the custom vscode settings for ".js" extensions in both JS and TS (we can probably remove JS ones now, since I got rid of the only .js file left in the project recently).

@thesoftwarephilosopher thesoftwarephilosopher added bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed icebox Do eventually labels Nov 5, 2021
@ramblingenzyme
Copy link

I'm happy to go through and have a look at the tsconfig settings + setup ts-jest. We use ts-jest internally with no issues and I've gotten pretty familiar with configuring Typescript.
Once you've got ts-jest setup, you can use Jest to watch tests, haven't had any issues with that.

What do you need VSCode to see changes in all files for to begin with?

@thesoftwarephilosopher
Copy link
Contributor Author

The ts-jest and VS Code tasks in here are just niceties. It's very easy to forget to run npm run watch in the background (or in VS Code itself), and not having to remember it frees up concentration to focus on the code itself. These are the only 2 places left to fix that in. It sounds like ts-jest probably solves that one, but I'm not sure anything can be done about having VS Code type-check unopened files. I briefly looked into it and found only this experimental flag which doesn't look promising yet. Once it's matured out of an experiment, it could be perfect. I doubt there are other current solutions but there could be.

@thesoftwarephilosopher
Copy link
Contributor Author

That pretty much resolves everything urgent in this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed icebox Do eventually
Projects
None yet
Development

No branches or pull requests

2 participants