Skip to content

Commit

Permalink
ci: improve tsconfig setup (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkluijk authored Nov 21, 2024
1 parent 0684b65 commit 561b935
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 35 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
"scripts": {
"check-types": "tsc",
"check-types:watch": "tsc -w",
"transpile": "tsc -p tsconfig.task.transpile.json",
"build:watch": "tsc -w",
"build": "tsc -p tsconfig.build.json",
"build:watch": "tsc -p tsconfig.build.json -w",
"test": "vitest run",
"test:watch": "vitest",
"test:ci": "vitest run --silent --coverage --coverage.reporter=json-summary",
Expand Down
8 changes: 5 additions & 3 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"compilerOptions": {
/* Reasonable default base options: */

// No emitting by default.
"noEmit": true,

// Of course, this is common practice in Node but also part of ES standards.
// todo: is there a way to enforce "with type"?
"resolveJsonModule": true,
Expand All @@ -29,8 +32,7 @@
"noUncheckedIndexedAccess": true,
"noImplicitOverride": true,

// restrictions are determined by what kind of transpiler and/or bundler we use.
// so by default, we preserve it.
"module": "Node16",
// Allow "Deno"-style imports
"allowImportingTsExtensions": true,
}
}
9 changes: 1 addition & 8 deletions tsconfig.task.transpile.json → tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
{
"extends": ["./tsconfig.base.json"],
"compilerOptions": {
// transpiling here, not checking. Yes... double-negatives.
"noCheck": true,
"noEmit": false,

"module": "NodeNext",
"moduleResolution": "NodeNext",

// please, yes.
"allowImportingTsExtensions": true,
"rewriteRelativeImportExtensions": true,

// yes, we're publishing a library here
"declaration": true,
"sourceMap": true,

"outDir": "dist"
},
"include": [
Expand Down
5 changes: 4 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"extends": "./tsconfig.task.check-types.json"
"extends": "./tsconfig.base.json",
"include": [
"./**/*.ts"
]
}
21 changes: 0 additions & 21 deletions tsconfig.task.check-types.json

This file was deleted.

0 comments on commit 561b935

Please sign in to comment.