diff --git a/.vercelignore b/.vercelignore index 28b39198a92d39..aefdea121a7559 100644 --- a/.vercelignore +++ b/.vercelignore @@ -15,7 +15,6 @@ !stylelint.config.js !tsconfig.json !config -!config/tsconfig.build.json !webpack.config.js !pnpm-lock.yaml !tests diff --git a/Makefile b/Makefile index 94828f5b86a7a2..6d4c283b6a25fd 100644 --- a/Makefile +++ b/Makefile @@ -105,7 +105,7 @@ test-cli: create-db test-js-build: @echo "--> Running type check" - @pnpm run tsc -p config/tsconfig.build.json + @pnpm run tsc -p tsconfig.json @echo "--> Building static assets" @NODE_ENV=production pnpm run build-profile > .artifacts/webpack-stats.json diff --git a/config/tsconfig.base.json b/config/tsconfig.base.json deleted file mode 100644 index 28e98d61b56eb4..00000000000000 --- a/config/tsconfig.base.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/tsconfig", - - "compilerOptions": { - // NOTE: We DO NOT use typescript to compile the application. Babel is - // responsible for handing transformation of tsx files into plain JavaScript - // compiles for the browser (and uses preset-env to determine what ECMA - // features are supported based on our browser usage configuration in - // package.json). `target` DOES NOT affect the babel output! [0] - // - // - // [0]: https://babeljs.io/docs/en/babel-preset-typescript - // [1]: https://node.green - "module": "preserve", - "target": "ES2022", - "moduleResolution": "bundler", - - // We add esnext to lib to pull in types for all newer ECMAScript features - "lib": ["esnext", "dom", "dom.iterable"], - - // Skip type checking of all declaration files - "skipLibCheck": true, - - // We do not actually use tsc to output any JavaScript anywhere - "noEmit": true, - - // Don't do anything to JSX. This doesn't really matter since we don't use - // typescript to compile files, but left here for documentation purposes. - "jsx": "preserve", - "jsxImportSource": "@emotion/react", - - // Type checking specific options - "alwaysStrict": false, - "noFallthroughCasesInSwitch": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noUncheckedIndexedAccess": true, - "strict": true, - "strictBindCallApply": false, - "useUnknownInCatchVariables": true, - // We do not configure these, but are left here for documentation purposes - // - // allowUnreachableCode - // allowUnusedLabels - // exactOptionalPropertyTypes - // noImplicitOverride - // noPropertyAccessFromIndexSignature - // strictFunctionTypes - // strictNullChecks - // strictPropertyInitialization - - // Emit configuration - "declaration": false, - "declarationMap": false, - "downlevelIteration": true, - "importHelpers": true, - "inlineSources": false, - "noEmitHelpers": true, - "sourceMap": true, - "pretty": false, - - // We do not configure these, but are left here for documentation purposes - // - // declarationDir - // emitBOM - // emitDeclarationOnly - // importsNotUsedAsValues - // inlineSourceMap - // mapRoot - // newLine - // noEmitHelpers - // noEmitOnError - // outDir - // outFile - // preserveConstEnums - // preserveValueImports - // removeComments - // sourceRoot - // andstripInternal - - // These get overridden when necessary - "allowJs": false, - "checkJs": false, - - "esModuleInterop": true, - "experimentalDecorators": true, - "resolveJsonModule": true, - "verbatimModuleSyntax": true, - - "paths": { - "@sentry/scraps/*": ["../static/app/components/core/*"], - "sentry/*": ["../static/app/*"], - "sentry-fixture/*": ["../tests/js/fixtures/*"], - "sentry-test/*": ["../tests/js/sentry-test/*"], - "getsentry-test/*": ["../tests/js/getsentry-test/*"], - "sentry-images/*": ["../static/images/*"], - "sentry-locale/*": ["../src/sentry/locale/*"], - "sentry-logos/*": ["../src/sentry/static/sentry/images/logos/*"], - "sentry-fonts/*": ["../static/fonts/*"], - "getsentry/*": ["../static/gsApp/*"], - "getsentry-images/*": ["../static/images/*"], - "admin/*": ["../static/gsAdmin/*"], - }, - - "plugins": [ - // The styled plugin provides language server autocompletion for styled - // component template strings - { - "name": "@styled/typescript-styled-plugin", - "lint": { - "validProperties": ["container-type"], - "unknownAtRules": "ignore" - } - } - ] - }, - "include": ["../static/app", "../static/gsApp", "../tests/js", "../static/eslint"], - "exclude": ["../node_modules"] -} diff --git a/config/tsconfig.build.json b/config/tsconfig.build.json deleted file mode 100644 index 2f54fa307fb070..00000000000000 --- a/config/tsconfig.build.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/tsconfig", - "extends": "./tsconfig.base.json", - "compilerOptions": { - "allowJs": true - }, - "exclude": [ - "../tests/js", - "../static/app/**/*.spec.*", - "../static/gsApp/**/*.spec.*" - ] -} diff --git a/config/tsconfig.ci.json b/config/tsconfig.ci.json deleted file mode 100644 index 520f43016ea99c..00000000000000 --- a/config/tsconfig.ci.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/tsconfig", - "extends": "./tsconfig.base.json", - "include": ["../static/app", "../tests/js"] -} diff --git a/rspack.config.ts b/rspack.config.ts index 75a3eb283628d0..4bfcd1d8b2cd0e 100644 --- a/rspack.config.ts +++ b/rspack.config.ts @@ -453,10 +453,7 @@ const appConfig: Configuration = { ? [ new TsCheckerRspackPlugin({ typescript: { - configFile: path.resolve( - import.meta.dirname, - './config/tsconfig.build.json' - ), + configFile: path.resolve(import.meta.dirname, './tsconfig.json'), }, devServer: false, }), diff --git a/tsconfig.json b/tsconfig.json index 23ad4884d11066..fd14932915e470 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,8 +1,83 @@ { - "extends": "./config/tsconfig.base.json", + "$schema": "http://json.schemastore.org/tsconfig", + "compilerOptions": { + // NOTE: We DO NOT use typescript to compile the application. SWC is + // responsible for handing transformation of tsx files into plain JavaScript + "module": "preserve", + "target": "ES2022", + "moduleResolution": "bundler", + + // We add esnext to lib to pull in types for all newer ECMAScript features + "lib": ["esnext", "dom", "dom.iterable"], + + // Skip type checking of all declaration files + "skipLibCheck": true, + + // We do not actually use tsc to output any JavaScript anywhere + "noEmit": true, + + // Don't do anything to JSX. This doesn't really matter since we don't use + // typescript to compile files, but left here for documentation purposes. + "jsx": "preserve", + "jsxImportSource": "@emotion/react", + + // Type checking specific options + "alwaysStrict": false, + "noFallthroughCasesInSwitch": true, + "noImplicitAny": true, + "noImplicitReturns": true, + "noImplicitThis": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noUncheckedIndexedAccess": true, + "strict": true, + "strictBindCallApply": false, + "useUnknownInCatchVariables": true, + + // Emit configuration + "declaration": false, + "declarationMap": false, + "downlevelIteration": true, + "importHelpers": true, + "inlineSources": false, + "noEmitHelpers": true, + "sourceMap": true, + "pretty": false, "allowJs": true, "checkJs": true, + + "esModuleInterop": true, + "experimentalDecorators": false, + "resolveJsonModule": true, + "verbatimModuleSyntax": true, + + "paths": { + "@sentry/scraps/*": ["./static/app/components/core/*"], + "sentry/*": ["./static/app/*"], + "sentry-fixture/*": ["./tests/js/fixtures/*"], + "sentry-test/*": ["./tests/js/sentry-test/*"], + "getsentry-test/*": ["./tests/js/getsentry-test/*"], + "sentry-images/*": ["./static/images/*"], + "sentry-locale/*": ["./src/sentry/locale/*"], + "sentry-logos/*": ["./src/sentry/static/sentry/images/logos/*"], + "sentry-fonts/*": ["./static/fonts/*"], + "getsentry/*": ["./static/gsApp/*"], + "getsentry-images/*": ["./static/images/*"], + "admin/*": ["./static/gsAdmin/*"], + }, + + "plugins": [ + // The styled plugin provides language server autocompletion for styled + // component template strings + { + "name": "@styled/typescript-styled-plugin", + "lint": { + "validProperties": ["container-type"], + "unknownAtRules": "ignore" + } + } + ] }, "include": [ "*.config.mjs", @@ -14,5 +89,6 @@ "tests/js", "config", "scripts" - ] + ], + "exclude": ["./node_modules"] }