Skip to content

Commit 4900195

Browse files
committed
refactor: update TypeScript configuration files to extend base settings, streamline project structure, and improve compatibility across packages
1 parent df71f21 commit 4900195

File tree

11 files changed

+88
-158
lines changed

11 files changed

+88
-158
lines changed

apps/backend/tsconfig.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
{
2+
"extends": "../../tsconfig.base.json",
23
"compilerOptions": {
4+
// NestJS specific settings
35
"module": "commonjs",
6+
"target": "ES2021",
47
"declaration": true,
58
"removeComments": true,
6-
"emitDecoratorMetadata": true,
7-
"experimentalDecorators": true,
89
"allowSyntheticDefaultImports": true,
9-
"target": "ES2021",
1010
"sourceMap": true,
1111
"outDir": "./dist",
1212
"baseUrl": "./",
13-
"incremental": true,
14-
"skipLibCheck": true,
13+
// Relaxed strict settings for backend
1514
"strictNullChecks": false,
1615
"noImplicitAny": false,
1716
"strictBindCallApply": false,
1817
"forceConsistentCasingInFileNames": false,
1918
"noFallthroughCasesInSwitch": false,
19+
// Path mapping
2020
"paths": {
2121
"@server/*": [
2222
"src/*"
23-
],
23+
]
2424
}
2525
},
2626
"include": [

apps/frontend/tsconfig.json

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,29 @@
11
{
2+
"extends": "../../tsconfig.base.json",
23
"compilerOptions": {
3-
"experimentalDecorators": true,
4-
"emitDecoratorMetadata": true,
5-
"incremental": true,
6-
"skipLibCheck": true,
7-
"strictNullChecks": true,
8-
"noImplicitAny": true,
9-
"strictBindCallApply": true,
10-
"forceConsistentCasingInFileNames": true,
11-
"noFallthroughCasesInSwitch": true,
12-
"strictPropertyInitialization": false,
4+
// Next.js specific settings
135
"target": "es5",
14-
"downlevelIteration": true,
156
"lib": [
167
"dom",
178
"dom.iterable",
189
"esnext"
1910
],
11+
"module": "esnext",
12+
"moduleResolution": "node",
13+
"jsx": "preserve",
14+
"downlevelIteration": true,
2015
"allowJs": true,
21-
"strict": true,
2216
"noEmit": true,
2317
"esModuleInterop": true,
24-
"module": "esnext",
25-
"moduleResolution": "node",
2618
"resolveJsonModule": true,
2719
"isolatedModules": true,
28-
"jsx": "preserve",
20+
// Override base strict settings for Next.js compatibility
21+
"strict": true,
22+
"strictNullChecks": true,
23+
"noImplicitAny": true,
24+
"strictBindCallApply": true,
25+
"strictPropertyInitialization": false,
26+
// Next.js plugins and types
2927
"plugins": [
3028
{
3129
"name": "next"
@@ -34,6 +32,7 @@
3432
"types": [
3533
"mdx"
3634
],
35+
// Path mapping
3736
"paths": {
3837
"@web/*": [
3938
"./src/*"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"start:server": "cd ./apps/backend && bun run start",
4242
"start:server:prod": "cd ./apps/backend && bun run start",
4343
"start:web:prod": "cd ./apps/frontend && bun run start",
44-
"dev": "concurrently --success first -n \"server,web,database,song,sounds,thumbnail,components\" --prefix-colors \"cyan,magenta,blue,green,yellow,red,white\" --prefix \"{name} {time}\" \"bun run dev:server\" \"bun run dev:web\" \"bun run dev:database\" \"bun run dev:song\" \"bun run dev:sounds\" \"bun run dev:thumbnail\" \"bun run dev:components\"",
44+
"dev": "concurrently --success first -n \"server,web,database,song,sounds,thumbnail,components\" --prefix-colors \"cyan,magenta,blue,green,yellow,red,white\" --prefix \"{name} {time}\" \"bun run start:server\" \"cd ./apps/frontend && bun run start\"",
4545
"lint": "bun run --filter '*' lint",
4646
"lint:server": "cd ./apps/backend && bun run lint",
4747
"lint:web": "cd ./apps/frontend && bun run lint",

packages/configs/tsconfig.json

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,7 @@
11
{
2-
"compilerOptions": {
3-
// Environment setup & latest features
4-
"lib": ["ESNext"],
5-
"target": "ESNext",
6-
"module": "Preserve",
7-
"moduleDetection": "force",
8-
"jsx": "react-jsx",
9-
"allowJs": true,
10-
11-
// Bundler mode
12-
"moduleResolution": "bundler",
13-
"allowImportingTsExtensions": true,
14-
"verbatimModuleSyntax": true,
15-
"noEmit": true,
16-
17-
// Best practices
18-
"strict": true,
19-
"skipLibCheck": true,
20-
"noFallthroughCasesInSwitch": true,
21-
"noUncheckedIndexedAccess": true,
22-
"noImplicitOverride": true,
23-
24-
// Some stricter flags (disabled by default)
25-
"noUnusedLocals": false,
26-
"noUnusedParameters": false,
27-
"noPropertyAccessFromIndexSignature": false
28-
}
29-
}
2+
"extends": "../../tsconfig.package.json",
3+
"compilerOptions": {
4+
// Package-specific overrides (if any)
5+
"module": "Preserve"
6+
}
7+
}

packages/database/tsconfig.json

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,23 @@
11
{
2+
"extends": "../../tsconfig.package.json",
23
"compilerOptions": {
4+
// Database-specific settings
35
"declaration": true,
46
"removeComments": true,
5-
"emitDecoratorMetadata": true,
6-
"experimentalDecorators": true,
77
"allowSyntheticDefaultImports": true,
88
"sourceMap": true,
99
"outDir": "./dist",
1010
"baseUrl": "./",
11-
"incremental": true,
11+
// Relaxed strict settings for database entities
1212
"strictNullChecks": false,
1313
"noImplicitAny": false,
1414
"strictBindCallApply": false,
1515
"forceConsistentCasingInFileNames": false,
16-
// Environment setup & latest features
17-
"lib": [
18-
"ESNext"
19-
],
20-
"target": "ESNext",
21-
"module": "ESNext",
22-
"moduleResolution": "bundler",
23-
"moduleDetection": "force",
24-
"jsx": "react-jsx",
25-
"allowJs": true,
26-
// Bundler mode
27-
//"moduleResolution": "",
28-
"allowImportingTsExtensions": true,
29-
"verbatimModuleSyntax": true,
30-
"noEmit": true,
31-
// Best practices
32-
"strict": true,
33-
"skipLibCheck": true,
34-
"noFallthroughCasesInSwitch": true,
35-
"noUncheckedIndexedAccess": true,
36-
// Some stricter flags (disabled by default)
37-
"noUnusedLocals": false,
38-
"noUnusedParameters": false,
39-
"noPropertyAccessFromIndexSignature": false,
16+
// Path mapping
4017
"paths": {
4118
"@database/*": [
4219
"src/*"
43-
],
20+
]
4421
}
4522
}
4623
}

packages/song/tsconfig.json

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,3 @@
11
{
2-
"compilerOptions": {
3-
// Environment setup & latest features
4-
"lib": ["ESNext"],
5-
"target": "ESNext",
6-
"module": "ESNext",
7-
"moduleDetection": "force",
8-
"jsx": "react-jsx",
9-
"allowJs": true,
10-
11-
// Bundler mode
12-
"moduleResolution": "bundler",
13-
"allowImportingTsExtensions": true,
14-
"verbatimModuleSyntax": true,
15-
"noEmit": true,
16-
17-
// Best practices
18-
"strict": true,
19-
"skipLibCheck": true,
20-
"noFallthroughCasesInSwitch": true,
21-
"noUncheckedIndexedAccess": true,
22-
23-
// Some stricter flags (disabled by default)
24-
"noUnusedLocals": false,
25-
"noUnusedParameters": false,
26-
"noPropertyAccessFromIndexSignature": false
27-
}
28-
}
2+
"extends": "../../tsconfig.package.json"
3+
}

packages/sounds/tsconfig.json

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,6 @@
11
{
2+
"extends": "../../tsconfig.package.json",
23
"compilerOptions": {
3-
"baseUrl": "./src",
4-
// Environment setup & latest features
5-
"lib": [
6-
"ESNext"
7-
],
8-
"target": "ESNext",
9-
"module": "ESNext",
10-
"moduleDetection": "force",
11-
"jsx": "react-jsx",
12-
"allowJs": true,
13-
// Bundler mode
14-
"moduleResolution": "bundler",
15-
"allowImportingTsExtensions": true,
16-
"verbatimModuleSyntax": true,
17-
"noEmit": true,
18-
// Best practices
19-
"strict": true,
20-
"skipLibCheck": true,
21-
"noFallthroughCasesInSwitch": true,
22-
"noUncheckedIndexedAccess": true,
23-
// Some stricter flags (disabled by default)
24-
"noUnusedLocals": false,
25-
"noUnusedParameters": false,
26-
"noPropertyAccessFromIndexSignature": false
4+
"baseUrl": "./src"
275
}
286
}

packages/thumbnail/tsconfig.json

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,11 @@
11
{
2+
"extends": "../../tsconfig.package.json",
23
"compilerOptions": {
3-
// Environment setup & latest features
4+
// DOM support for canvas operations
45
"lib": [
56
"dom",
67
"dom.iterable",
78
"esnext"
8-
],
9-
"target": "ESNext",
10-
"module": "ESNext",
11-
"moduleDetection": "force",
12-
"jsx": "react-jsx",
13-
"allowJs": true,
14-
// Bundler mode
15-
"moduleResolution": "bundler",
16-
"allowImportingTsExtensions": true,
17-
"verbatimModuleSyntax": true,
18-
"noEmit": true,
19-
// Best practices
20-
"strict": true,
21-
"skipLibCheck": true,
22-
"noFallthroughCasesInSwitch": true,
23-
"noUncheckedIndexedAccess": true,
24-
// Some stricter flags (disabled by default)
25-
"noUnusedLocals": false,
26-
"noUnusedParameters": false,
27-
"noPropertyAccessFromIndexSignature": false
9+
]
2810
}
2911
}

tsconfig.base.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"compilerOptions": {
3+
// Base strict settings
4+
"strict": true,
5+
"skipLibCheck": true,
6+
"noFallthroughCasesInSwitch": true,
7+
"forceConsistentCasingInFileNames": true,
8+
// Modern JavaScript features
9+
"target": "ESNext",
10+
"lib": [
11+
"ESNext"
12+
],
13+
"allowJs": true,
14+
"moduleDetection": "force",
15+
// Build performance
16+
"incremental": true,
17+
// Decorator support for backend compatibility
18+
"experimentalDecorators": true,
19+
"emitDecoratorMetadata": true
20+
},
21+
"exclude": [
22+
"node_modules",
23+
"dist",
24+
"**/*.spec.ts",
25+
"**/*.test.ts"
26+
]
27+
}

tsconfig.json

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
{
2+
"extends": "./tsconfig.base.json",
23
"compilerOptions": {
3-
"baseUrl": ".",
4-
"experimentalDecorators": true,
5-
"emitDecoratorMetadata": true,
6-
"incremental": true,
7-
"skipLibCheck": true,
4+
// Root project specific overrides
85
"strictNullChecks": true,
96
"noImplicitAny": true,
107
"strictBindCallApply": true,
11-
"forceConsistentCasingInFileNames": true,
12-
"noFallthroughCasesInSwitch": true,
13-
"strictPropertyInitialization": false,
8+
"strictPropertyInitialization": false
149
}
1510
}

0 commit comments

Comments
 (0)