An opinionated project generator for TypeScript projects.
To run it just once:
$ npx <TODO>
If you find yourself using the generator for a lot of new projects, we recommend Volta, which has a great story around “global” installs:
$ volta install <TODO>
$ <TODO>
- Use Babel for compilation.
- Use the equivalent of
strict: true
- Generate ES Modules
TypeScript and Babel’s compilation output differs in subtle but important ways for some proposed JavaScript features, especially decorators. In order to guarantee correct interop between libraries generated with this tool and the JavaScript ecosystem, TypeScript is used only for type-checking, not for compilation.
TypeScript is most useful with all of its strictness settings turned on. However, as a matter of stability, actually using strict: true
can cause code to stop compiling between minor releases. By setting these configuration options manually, the generator can improve backwards-compatible stability between upgrades, with users able to opt into new levels of strictness at will rather than it being forced by a TypeScript version release (which may be desired for other reasons).
ECMAScript Modules are the language standard module format, are supported in all modern/evergreen browsers, and are on track to be fully supported by Node.js. Where interop with other module systems is necessary, all modern bundlers support transforming ES Modules into the target format.