Foundation for setting up a Typescript project that has support for linting, testing, and debugging. This is a simple example, feel free to fork or even add pull requests to this project to share with others.
I typically use pnpm as a Package Manager but everything will work with npm
as well. Anywhere you see reference to pnpm
and some command it just means it is using pnpm
. Examples of both pnpm
and npm
are provided.
- Install your IDE of choice, such as Visual Studio Code
- Clone this repository locally
- Run
pnpm install
ornpm install
- Run
pnpm dev
ornpm run dev
to run the simple example
Run pnpm build
or npm run build
to generate the dist
folder with files for build
A simple test is provided here and is setup using Jest. You can run the test either running pnpm test
or npm run test
.
Linting is configured for the project, run pnpm lint
or npm run lint
A sample launch configuration has been added to use if you are using Visual Studio Code here. Use VS Code Run and Debug and launch the dev configuration. Note that the launch is setup to use pnpm
currently but you can alter this by modifying the following values to work with npm
"runtimeArgs": ["run", "dev"],
"runtimeExecutable": "npm",