/minimal-typescript-starter

A minimal typescript starter from a bunch of tutorials. Hand-made with love. Has tests, some boilerplate, and all you need for a complete (backend+frontend) app. (Mirrored from gitea)

Primary LanguageTypeScript

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
  • prettier, because I don't feel like configuring eslint much
  • mocha, because tests should always be done
  • A few runner tools like:
    • nodemon, to provide an easy dev server
    • ts-node, to compile and run typescript without having to use tsc

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:

And should also explore:

About using mocha: https://javascript.info/testing-mocha