Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions modules/core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.json",
"extends": "../../tsconfig.build.json",
"include": ["src/**/*"],
"exclude": ["node_modules"],
"compilerOptions": {
Expand All @@ -10,4 +10,4 @@
"references": [
{"path": "../types"}
]
}
}
4 changes: 2 additions & 2 deletions modules/culling/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.json",
"extends": "../../tsconfig.build.json",
"include": ["src/**/*"],
"exclude": ["node_modules"],
"compilerOptions": {
Expand All @@ -11,4 +11,4 @@
{"path": "../types"},
{"path": "../core"}
]
}
}
4 changes: 2 additions & 2 deletions modules/dggs-geohash/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.json",
"extends": "../../tsconfig.build.json",
"include": ["src/**/*"],
"exclude": ["node_modules"],
"compilerOptions": {
Expand All @@ -11,4 +11,4 @@
{"path": "../types"},
{"path": "../web-mercator"}
]
}
}
4 changes: 2 additions & 2 deletions modules/dggs-quadkey/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.json",
"extends": "../../tsconfig.build.json",
"include": ["src/**/*"],
"exclude": ["node_modules"],
"compilerOptions": {
Expand All @@ -10,4 +10,4 @@
"references": [
{"path": "../types"}
]
}
}
4 changes: 2 additions & 2 deletions modules/dggs-s2/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.json",
"extends": "../../tsconfig.build.json",
"include": ["src/**/*"],
"exclude": ["node_modules"],
"compilerOptions": {
Expand All @@ -10,4 +10,4 @@
"references": [
{"path": "../types"}
]
}
}
4 changes: 2 additions & 2 deletions modules/geoid/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.json",
"extends": "../../tsconfig.build.json",
"include": ["src/**/*"],
"exclude": ["node_modules"],
"compilerOptions": {
Expand All @@ -11,4 +11,4 @@
{"path": "../types"},
{"path": "../core"}
]
}
}
4 changes: 2 additions & 2 deletions modules/geospatial/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.json",
"extends": "../../tsconfig.build.json",
"include": ["src/**/*"],
"exclude": ["node_modules"],
"compilerOptions": {
Expand All @@ -12,4 +12,4 @@
{"path": "../core"},
{"path": "../culling"}
]
}
}
4 changes: 2 additions & 2 deletions modules/main/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.json",
"extends": "../../tsconfig.build.json",
"include": ["src/**/*"],
"exclude": ["node_modules"],
"compilerOptions": {
Expand All @@ -11,4 +11,4 @@
{"path": "../types"},
{"path": "../core"}
]
}
}
4 changes: 2 additions & 2 deletions modules/polygon/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.json",
"extends": "../../tsconfig.build.json",
"include": ["src/**/*"],
"exclude": ["node_modules"],
"compilerOptions": {
Expand All @@ -10,4 +10,4 @@
"references": [
{"path": "../core"}
]
}
}
4 changes: 2 additions & 2 deletions modules/proj4/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.json",
"extends": "../../tsconfig.build.json",
"include": ["src/**/*"],
"exclude": ["node_modules"],
"compilerOptions": {
Expand All @@ -11,4 +11,4 @@
{"path": "../types"},
{"path": "../core"}
]
}
}
4 changes: 2 additions & 2 deletions modules/sun/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.json",
"extends": "../../tsconfig.build.json",
"include": ["src/**/*"],
"exclude": ["node_modules"],
"compilerOptions": {
Expand All @@ -10,4 +10,4 @@
"references": [
{"path": "../types"}
]
}
}
4 changes: 2 additions & 2 deletions modules/types/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.json",
"extends": "../../tsconfig.build.json",
"include": ["src/**/*"],
"exclude": ["node_modules"],
"compilerOptions": {
Expand All @@ -8,4 +8,4 @@
"outDir": "dist"
},
"references": []
}
}
4 changes: 2 additions & 2 deletions modules/web-mercator/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.json",
"extends": "../../tsconfig.build.json",
"include": ["src/**/*"],
"exclude": ["node_modules"],
"compilerOptions": {
Expand All @@ -11,4 +11,4 @@
"references": [
{"path": "../types"}
]
}
}
74 changes: 74 additions & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"compilerOptions": {
"target": "es2020",
"allowJs": true,
"checkJs": false,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"rootDir": ".",
"useDefineForClassFields": false,

// BEGIN TYPE CHECK SETTINGS
"skipLibCheck": true,

"strict": false,

"noImplicitAny": false,
"noImplicitThis": true,
"strictBindCallApply": true,
"strictFunctionTypes": true,
"useUnknownInCatchVariables": true,
// "strictNullChecks": true,
// "strictPropertyInitialization": true,

// "exactOptionalPropertyTypes": true, - requires strictNullChecks
"noFallthroughCasesInSwitch": true,
"noImplicitOverride": true,
"noImplicitReturns": true,
"noPropertyAccessFromIndexSignature": true,
"noUncheckedIndexedAccess": true,
"noUnusedLocals": true,
"noUnusedParameters": false,
// END TYPE CHECK SETTINGS

"paths": {
"@math.gl/core/*": ["./modules/core/src/*"],
"@math.gl/core/test/*": ["./modules/core/test/*"],
"@math.gl/culling/*": ["./modules/culling/src/*"],
"@math.gl/culling/test/*": ["./modules/culling/test/*"],
"@math.gl/dggs-pgeohash/*": ["./modules/dggs-pgeohash/src/*"],
"@math.gl/dggs-pgeohash/test/*": ["./modules/dggs-pgeohash/test/*"],
"@math.gl/dggs-s2/*": ["./modules/dggs-s2/src/*"],
"@math.gl/dggs-s2/test/*": ["./modules/dggs-s2/test/*"],
"@math.gl/dggs-quadkey/*": ["./modules/dggs-quadkey/src/*"],
"@math.gl/dggs-quadkey/test/*": ["./modules/dggs-quadkey/test/*"],
"@math.gl/geoid/*": ["./modules/geoid/src/*"],
"@math.gl/geoid/test/*": ["./modules/geoid/test/*"],
"@math.gl/geospatial/*": ["./modules/geospatial/src/*"],
"@math.gl/geospatial/test/*": ["./modules/geospatial/test/*"],
"@math.gl/polygon/*": ["./modules/polygon/src/*"],
"@math.gl/polygon/test/*": ["./modules/polygon/test/*"],
"@math.gl/proj4/*": ["./modules/proj4/src/*"],
"@math.gl/proj4/test/*": ["./modules/proj4/test/*"],
"@math.gl/sun/*": ["./modules/sun/src/*"],
"@math.gl/sun/test/*": ["./modules/sun/test/*"],
"@math.gl/types/*": ["./modules/types/src/*"],
"@math.gl/types/test/*": ["./modules/types/test/*"],
"@math.gl/web-mercator/*": ["./modules/web-mercator/src/*"],
"@math.gl/web-mercator/test/*": ["./modules/web-mercator/test/*"],
"test/*": ["./test/*"]
},
"plugins": [
{
"transform": "@vis.gl/ts-plugins/ts-transform-append-extension",
"extensions": [".js"],
"after": true
},
{
"transform": "@vis.gl/ts-plugins/ts-transform-append-extension",
"extensions": [".js"],
"afterDeclarations": true
}
]
}
}
10 changes: 10 additions & 0 deletions tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
// Library builds target standard ESM output instead of Node-specific emit.
"module": "es2020",
// Bundler resolution avoids deprecated legacy node resolution while keeping
// package builds compatible with extensionless source imports.
"moduleResolution": "bundler"
}
}
82 changes: 8 additions & 74 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,84 +1,18 @@
{
"extends": "./tsconfig.base.json",
"ts-node": {
// It is faster to skip typechecking. Remove if you want ts-node to do typechecking.
"transpileOnly": true
},

"compilerOptions": {
"target": "es2020",
"module": "es2020",
"allowJs": true,
"checkJs": false,
"moduleResolution": "node",
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"rootDir": ".",
"baseUrl": ".",
"ignoreDeprecations": "6.0",
"useDefineForClassFields": false,

// BEGIN TYPE CHECK SETTINGS
"skipLibCheck": true,

"strict": false,

"noImplicitAny": false, // covered by strict
"noImplicitThis": true, // covered by strict
"strictBindCallApply": true, // covered by strict
"strictFunctionTypes": true, // covered by strict
"useUnknownInCatchVariables": true, // covered by strict
// "strictNullChecks": true, // covered by strict
// "strictPropertyInitialization": true, // covered by strict, requires strict null checks

// "exactOptionalPropertyTypes": true, - requires strictNullChecks
"noFallthroughCasesInSwitch": true,
"noImplicitOverride": true,
"noImplicitReturns": true,
"noPropertyAccessFromIndexSignature": true,
"noUncheckedIndexedAccess": true,
"noUnusedLocals": true,
"noUnusedParameters": false,
// END TYPE CHECK SETTINGS

"paths": {
"@math.gl/core/*": ["modules/core/src/*"],
"@math.gl/core/test/*": ["modules/core/test/*"],
"@math.gl/culling/*": ["modules/culling/src/*"],
"@math.gl/culling/test/*": ["modules/culling/test/*"],
"@math.gl/dggs-pgeohash/*": ["modules/dggs-pgeohash/src/*"],
"@math.gl/dggs-pgeohash/test/*": ["modules/dggs-pgeohash/test/*"],
"@math.gl/dggs-s2/*": ["modules/dggs-s2/src/*"],
"@math.gl/dggs-s2/test/*": ["modules/dggs-s2/test/*"],
"@math.gl/dggs-quadkey/*": ["modules/dggs-quadkey/src/*"],
"@math.gl/dggs-quadkey/test/*": ["modules/dggs-quadkey/test/*"],
"@math.gl/geoid/*": ["modules/geoid/src/*"],
"@math.gl/geoid/test/*": ["modules/geoid/test/*"],
"@math.gl/geospatial/*": ["modules/geospatial/src/*"],
"@math.gl/geospatial/test/*": ["modules/geospatial/test/*"],
"@math.gl/polygon/*": ["modules/polygon/src/*"],
"@math.gl/polygon/test/*": ["modules/polygon/test/*"],
"@math.gl/proj4/*": ["modules/proj4/src/*"],
"@math.gl/proj4/test/*": ["modules/proj4/test/*"],
"@math.gl/sun/*": ["modules/sun/src/*"],
"@math.gl/sun/test/*": ["modules/sun/test/*"],
"@math.gl/types/*": ["modules/types/src/*"],
"@math.gl/types/test/*": ["modules/types/test/*"],
"@math.gl/web-mercator/*": ["modules/web-mercator/src/*"],
"@math.gl/web-mercator/test/*": ["modules/web-mercator/test/*"],
"test/*": ["test/*"]
},
"plugins": [
{
"transform": "@vis.gl/ts-plugins/ts-transform-append-extension",
"extensions": [".js"],
"after": true
},
{
"transform": "@vis.gl/ts-plugins/ts-transform-append-extension",
"extensions": [".js"],
"afterDeclarations": true
}
]
// Use Node 20 module semantics in repo-level tooling and tests so TypeScript
// understands modern package.json features such as "exports".
"module": "Node20",
// TypeScript does not currently expose a separate "node20" resolution mode.
// The Node-style resolver remains under the node16/nodenext family, and this
// is the stable choice for Node-oriented workflows in this repo.
"moduleResolution": "node16"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use bundler resolution for root TypeScript config

Setting moduleResolution to node16 in the repo-level tsconfig.json makes TypeScript enforce explicit file extensions for ESM relative imports, but this config still includes modules/*/src and modules/*/test, which contain many extensionless imports (for example import './common'). As a result, any tooling that type-checks against the root config (e.g. tsc -p tsconfig.json or editor diagnostics) now reports a large number of TS2835 errors, which is a regression from the previous config behavior.

Useful? React with 👍 / 👎.

},
"include":[
"modules/*/src",
Expand Down
Loading