Skip to content

Commit ff62337

Browse files
committed
Adjust tsconfig and import path
This splits the tsconfig up so that we now have - a project-wide tsconfig.json for rules and typechecking - a specific tsconfig.declarations.json only for emitting the declarations This also changes `bun:util` to `node:util` to avoid the types warning.
1 parent 5b26600 commit ff62337

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"all": "run-s clean lint build test",
3333
"build": "run-p build:js build:ts",
3434
"build:js": "bun ./scripts/build_js.ts",
35-
"build:ts": "tsc",
35+
"build:ts": "tsc --project tsconfig.declarations.json",
3636
"clean": "bun ./scripts/clean.ts",
3737
"lint": "eslint ./scripts ./src ./test",
3838
"start": "bun ./scripts/server.ts",

scripts/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { styleText } from 'bun:util';
1+
import { styleText } from 'node:util';
22

33
const project = 'location-conflation';
44
const hostname = '127.0.0.1';

tsconfig.declarations.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"include": ["src/location-conflation.ts"],
4+
"compilerOptions": {
5+
"declaration": true,
6+
"declarationDir": "./dist/ts",
7+
"emitDeclarationOnly": true,
8+
"noEmit": false
9+
}
10+
}

tsconfig.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
2-
"include": ["src/location-conflation.ts"],
2+
"include": ["**/*.ts"],
33
"compilerOptions": {
44
"module": "esnext",
5-
"declaration": true,
6-
"declarationDir": "./dist/ts",
7-
"emitDeclarationOnly": true,
5+
"declaration": false,
6+
"noEmit": true,
87
"outDir": "dist",
98
"esModuleInterop": true,
109
"moduleResolution": "bundler",
1110
"allowImportingTsExtensions": true,
11+
"moduleDetection": "force",
1212
"noImplicitAny": false,
1313
"noImplicitReturns": true,
1414
"noImplicitThis": true,

0 commit comments

Comments
 (0)