9.0.0 • Published 10 months ago

@4s1/ts-config v9.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

TS Config

This repository is used to centrally manage the base TypeScript configurations for all 4s1 organization projects. All tsconfig files are based on recommendation from https://github.com/tsconfig/bases.

Node 20

  • @4s1/ts-config/tsconfig-node.json extends
    1. @tsconfig/strictest/tsconfig.json
    2. @tsconfig/node20/tsconfig.json
    3. {
        "verbatimModuleSyntax": false,
        "exactOptionalPropertyTypes": false
      }
  • @4s1/ts-config/tsconfig-node-wo-sourcemaps.json same as above plus
    {
      "declaration": false,
      "declarationMap": false,
      "sourceMap": false,
      "inlineSources": false
    }

Using

Install this package to get the configurations.

# npm
npm install @4s1/ts-config --save-dev
# pnpm
pnpm add @4s1/ts-config --save-dev

Create a tsconfig.json file and insert the following configuration. If you do not want sourcemaps you can extend from tsconfig-node-wo-sourcemaps.json.

{
  "$schema": "https://json.schemastore.org/tsconfig",
  "extends": "@4s1/ts-config/tsconfig-node.json",
  "compilerOptions": {
    "outDir": "./dist",
    "rootDir": "./src"
  },
  "include": ["src/**/*.ts"],
  "exclude": ["src/**/*.spec.ts", "node_modules/"]
}

Create a tsconfig-dev.json file and insert the following configuration. This extends your previously created tsconfig.json and turns off some strict checking at development time.

{
  "$schema": "https://json.schemastore.org/tsconfig",
  "extends": "./tsconfig.json",
  "compilerOptions": {
    "noUnusedLocals": false,
    "noUnusedParameters": false
  }
}

Finally build tasks for production and development have to be created. Add the following scripts to your package.json.

{
  "scripts": {
    "build": "rm -rf dist && tsc",
    "build:dev": "rm -rf dist && tsc --project tsconfig.dev.json"
  }
}

How to update configs

# Create tsconfig files
./build.mjs
# Format tsconfig files
pnpm run format

# Compare changes
git diff

# Think about the changes

# Think about the changes again

# Commit what you want/need
9.0.0

10 months ago

8.1.0

2 years ago

8.0.0

2 years ago

7.0.0

2 years ago

5.3.0

2 years ago

6.0.0

2 years ago

5.2.1

2 years ago

5.2.0

2 years ago

5.1.0

2 years ago

5.0.1

2 years ago

5.0.0

2 years ago

4.3.2

2 years ago

4.3.1

2 years ago

4.1.0

2 years ago

4.0.0

3 years ago

4.3.0

2 years ago

4.2.0

2 years ago

4.1.1

2 years ago

3.0.2

3 years ago

3.0.1

3 years ago

3.0.0

3 years ago

2.1.0

3 years ago

2.0.0

3 years ago

1.4.1

4 years ago

1.4.0

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago