Skip to content

A package containing what HT2 Labs needs for TypeScript projects.

License

Notifications You must be signed in to change notification settings

HT2-Labs/typescript-project

Repository files navigation

TypeScript Project

Package containing scripts and configs that HT2 Labs need for TypeScript projects.

Usage

  1. Install with npm i -D -E @ht2-labs/typescript-project@latest.
  2. Create a "tsconfig.json" file in the root of your repository using the example TS config.
  3. Create a "tslint.json" file in the root of your repository using the example TSLint config.
  4. Add a lint script to your package.json file using tslint.
  5. Add a build script to your package.json file using tsc.
  6. Add /dist to your .gitignore file.
  7. Create a src folder in the root of your repository for all TypeScript source code.

TS Config Example

{
  "extends": "./node_modules/@ht2-labs/typescript-project/configs/tsconfig.json",
  "compilerOptions": {
    "rootDir": "src",
    "outDir": "dist",
    "typeRoots": ["./@types", "./node_modules/@types"],
  },
  "include": ["src/**/*"],
  "exclude": ["node_modules", "dist/**/*"]
}

TSLint Config Example

{
  "extends": [
    "./node_modules/@ht2-labs/typescript-project/configs/tslint.json"
  ]
}