Skip to content

Commit b9859c1

Browse files
authored
build(ui): Consolidate tsconfig files (#106034)
consolidates tsconfig files that i think we left hanging around after finishing migrating to typescript. I don't think the complexity of having 3 tsconfigs is worth whatever slight speed increase we see from not typechecking a subset of files. rspack config can be setup to exclude tests if we need to exclude them there merges root tsconfig with `tsconfig.base.json` and also: - experimentalDecorators is now false - allowJs and checkJs are true - cleanup huge comments of unused config
1 parent c452b50 commit b9859c1

File tree

7 files changed

+80
-147
lines changed

7 files changed

+80
-147
lines changed

.vercelignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
!stylelint.config.js
1616
!tsconfig.json
1717
!config
18-
!config/tsconfig.build.json
1918
!webpack.config.js
2019
!pnpm-lock.yaml
2120
!tests

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ test-cli: create-db
105105

106106
test-js-build:
107107
@echo "--> Running type check"
108-
@pnpm run tsc -p config/tsconfig.build.json
108+
@pnpm run tsc -p tsconfig.json
109109
@echo "--> Building static assets"
110110
@NODE_ENV=production pnpm run build-profile > .artifacts/webpack-stats.json
111111

config/tsconfig.base.json

Lines changed: 0 additions & 122 deletions
This file was deleted.

config/tsconfig.build.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

config/tsconfig.ci.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

rspack.config.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -453,10 +453,7 @@ const appConfig: Configuration = {
453453
? [
454454
new TsCheckerRspackPlugin({
455455
typescript: {
456-
configFile: path.resolve(
457-
import.meta.dirname,
458-
'./config/tsconfig.build.json'
459-
),
456+
configFile: path.resolve(import.meta.dirname, './tsconfig.json'),
460457
},
461458
devServer: false,
462459
}),

tsconfig.json

Lines changed: 78 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,83 @@
11
{
2-
"extends": "./config/tsconfig.base.json",
2+
"$schema": "http://json.schemastore.org/tsconfig",
3+
34
"compilerOptions": {
5+
// NOTE: We DO NOT use typescript to compile the application. SWC is
6+
// responsible for handing transformation of tsx files into plain JavaScript
7+
"module": "preserve",
8+
"target": "ES2022",
9+
"moduleResolution": "bundler",
10+
11+
// We add esnext to lib to pull in types for all newer ECMAScript features
12+
"lib": ["esnext", "dom", "dom.iterable"],
13+
14+
// Skip type checking of all declaration files
15+
"skipLibCheck": true,
16+
17+
// We do not actually use tsc to output any JavaScript anywhere
18+
"noEmit": true,
19+
20+
// Don't do anything to JSX. This doesn't really matter since we don't use
21+
// typescript to compile files, but left here for documentation purposes.
22+
"jsx": "preserve",
23+
"jsxImportSource": "@emotion/react",
24+
25+
// Type checking specific options
26+
"alwaysStrict": false,
27+
"noFallthroughCasesInSwitch": true,
28+
"noImplicitAny": true,
29+
"noImplicitReturns": true,
30+
"noImplicitThis": true,
31+
"noUnusedLocals": true,
32+
"noUnusedParameters": true,
33+
"noUncheckedIndexedAccess": true,
34+
"strict": true,
35+
"strictBindCallApply": false,
36+
"useUnknownInCatchVariables": true,
37+
38+
// Emit configuration
39+
"declaration": false,
40+
"declarationMap": false,
41+
"downlevelIteration": true,
42+
"importHelpers": true,
43+
"inlineSources": false,
44+
"noEmitHelpers": true,
45+
"sourceMap": true,
46+
"pretty": false,
447
"allowJs": true,
548
"checkJs": true,
49+
50+
"esModuleInterop": true,
51+
"experimentalDecorators": false,
52+
"resolveJsonModule": true,
53+
"verbatimModuleSyntax": true,
54+
55+
"paths": {
56+
"@sentry/scraps/*": ["./static/app/components/core/*"],
57+
"sentry/*": ["./static/app/*"],
58+
"sentry-fixture/*": ["./tests/js/fixtures/*"],
59+
"sentry-test/*": ["./tests/js/sentry-test/*"],
60+
"getsentry-test/*": ["./tests/js/getsentry-test/*"],
61+
"sentry-images/*": ["./static/images/*"],
62+
"sentry-locale/*": ["./src/sentry/locale/*"],
63+
"sentry-logos/*": ["./src/sentry/static/sentry/images/logos/*"],
64+
"sentry-fonts/*": ["./static/fonts/*"],
65+
"getsentry/*": ["./static/gsApp/*"],
66+
"getsentry-images/*": ["./static/images/*"],
67+
"admin/*": ["./static/gsAdmin/*"],
68+
},
69+
70+
"plugins": [
71+
// The styled plugin provides language server autocompletion for styled
72+
// component template strings
73+
{
74+
"name": "@styled/typescript-styled-plugin",
75+
"lint": {
76+
"validProperties": ["container-type"],
77+
"unknownAtRules": "ignore"
78+
}
79+
}
80+
]
681
},
782
"include": [
883
"*.config.mjs",
@@ -14,5 +89,6 @@
1489
"tests/js",
1590
"config",
1691
"scripts"
17-
]
92+
],
93+
"exclude": ["./node_modules"]
1894
}

0 commit comments

Comments
 (0)