Skip to content

Commit 8ba039c

Browse files
committed
build: move shared TypeScript configuration to project root instead of extending
For consistency, up until now, the shared TypeScript configuration has lived in `src/config` with all of the other shared configurations that this package provides. For all of the other configurations we're able to simple re-export the configuration at the project root to provide it to consumers at `require('@hover/javascript/[config]')`. Because the TypeScript configuration is JSON, however, we were using `extends` instead of re-exporting. This has been causing all kinds of trouble within this package since we were extending from the `dist` directory. This finally moves the canonical TypeScript configuration to the root, so that we don't need to `extends` from `dist/` while preserving `src/config/tsconfig.json` via `extends` just in case. The actual configuration for this project itself still lives at `src/tsconfig.json`, but this prevents issues when anything (like the `ts-node` that gets loaded in `commitlint` from trying to read a non-existent `dist/tsconfig.json` if it does read the `tsconfig.json` at the root of the project.
1 parent fcb02d2 commit 8ba039c

File tree

2 files changed

+22
-25
lines changed

2 files changed

+22
-25
lines changed

Diff for: src/config/tsconfig.json

+1-23
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,3 @@
11
{
2-
"compilerOptions": {
3-
"alwaysStrict": true,
4-
"declaration": true,
5-
"esModuleInterop": true,
6-
"importHelpers": true,
7-
"jsx": "react",
8-
"lib": ["dom", "esnext"],
9-
"module": "esnext",
10-
"moduleResolution": "node",
11-
"noFallthroughCasesInSwitch": true,
12-
"noImplicitAny": true,
13-
"noImplicitReturns": true,
14-
"noImplicitThis": true,
15-
"noUnusedLocals": false,
16-
"noUnusedParameters": true,
17-
"resolveJsonModule": true,
18-
"sourceMap": true,
19-
"strict": true,
20-
"strictFunctionTypes": true,
21-
"strictNullChecks": true,
22-
"strictPropertyInitialization": true,
23-
"target": "es5"
24-
}
2+
"extends": "../../tsconfig.json"
253
}

Diff for: tsconfig.json

+21-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
11
{
2-
"extends": "./dist/config/tsconfig",
32
"compilerOptions": {
4-
"allowJs": true
3+
"alwaysStrict": true,
4+
"declaration": true,
5+
"esModuleInterop": true,
6+
"importHelpers": true,
7+
"jsx": "react",
8+
"lib": ["dom", "esnext"],
9+
"module": "esnext",
10+
"moduleResolution": "node",
11+
"noFallthroughCasesInSwitch": true,
12+
"noImplicitAny": true,
13+
"noImplicitReturns": true,
14+
"noImplicitThis": true,
15+
"noUnusedLocals": false,
16+
"noUnusedParameters": true,
17+
"resolveJsonModule": true,
18+
"sourceMap": true,
19+
"strict": true,
20+
"strictFunctionTypes": true,
21+
"strictNullChecks": true,
22+
"strictPropertyInitialization": true,
23+
"target": "es5"
524
}
625
}

0 commit comments

Comments
 (0)