8.1.0 • Published 1 month ago

@4s1/ts-config v8.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
1 month 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
8.1.0

1 month ago

8.0.0

2 months ago

7.0.0

6 months ago

5.3.0

6 months ago

6.0.0

6 months ago

5.2.1

10 months ago

5.2.0

10 months ago

5.1.0

10 months ago

5.0.1

11 months ago

5.0.0

11 months ago

4.3.2

1 year ago

4.3.1

1 year ago

4.1.0

1 year ago

4.0.0

1 year ago

4.3.0

1 year ago

4.2.0

1 year ago

4.1.1

1 year ago

3.0.2

1 year ago

3.0.1

1 year ago

3.0.0

1 year ago

2.1.0

2 years ago

2.0.0

2 years ago

1.4.1

2 years ago

1.4.0

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago