Minimal Typescript starter
This project is my (CyberFoxar) minimal typescript starter project. It is not as-is production-ready, but is meant more as a toy project to quickly try out and start stuff.
It has what I consider a "minimal easy config":
- Using yarn as a package manager, because I like it.
- Typescript, because types are nice
- The types for everything else, too.
- esLint, because linting is nice to have
- A bunch of plugins to make eslint work with typescript (from their getting started page, and their autoconfig here)
- prettier, because I don't feel like configuring eslint much
- mocha, because tests should always be done
- A few runner tools like:
There is a lot of config files (*.json in root) that should make the tools painless to use, and somewhat easy to configure. Be aware that prettier's rules override eslint's when configuring both, see also this write-up on prettier's website.
You should be able to remove any of those component without too much pain as-is.
I advise you to take a look at the package.json for the run scripts and dependencies. The only unusual thing would be the use of a tsconfig-build.json to remove the test from compilation output (but still have mocha read them when developping).
There is also in the .vscode folder, a small Visual Studio Code workspace that has 2 recommended extensions and the configuration needed to make them work, use it as you wish.
More Resources
Inspiration for this repo taken from those tutorials:
- https://bobaekang.com/blog/minimal-typescript-project-setup-for-curious-minds/
- https://khalilstemmler.com/blogs/typescript/node-starter-project/
And should also explore:
- https://github.com/Microsoft/TypeScript-Node-Starter
- https://www.typescriptlang.org/download
- https://mindsers.blog/fr/post/coder-serveur-http-nodejs/
About using mocha: https://javascript.info/testing-mocha