From 061b9b671cee08a33e7a01db7d7d00e2587ea13a Mon Sep 17 00:00:00 2001 From: Martin Schoeler Date: Thu, 10 Nov 2022 14:45:06 -0300 Subject: [PATCH] Chore: Improve configurations related to Typescript in Livechat (#27232) --- packages/livechat/package.json | 4 ++-- packages/livechat/tsconfig.json | 3 +++ packages/livechat/tsconfig.typecheck.json | 8 ++++++++ packages/livechat/webpack.config.js | 4 ++-- yarn.lock | 21 ++------------------- 5 files changed, 17 insertions(+), 23 deletions(-) create mode 100644 packages/livechat/tsconfig.typecheck.json diff --git a/packages/livechat/package.json b/packages/livechat/package.json index 3f427bc1c438..8d63e6c51fd7 100644 --- a/packages/livechat/package.json +++ b/packages/livechat/package.json @@ -20,7 +20,8 @@ "eslint": "eslint src", "stylelint": "stylelint 'src/**/*.scss'", "storybook": "start-storybook -p 9001 -c .storybook", - "build-storybook": "build-storybook" + "build-storybook": "build-storybook", + "typecheck": "tsc -p tsconfig.typecheck.json" }, "devDependencies": { "@babel/eslint-parser": "^7.18.9", @@ -74,7 +75,6 @@ "stylelint": "^14.9.1", "stylelint-order": "^5.0.0", "svg-loader": "^0.0.2", - "ts-loader": "^8.4.0", "typescript": "~4.5.5", "url-loader": "^4.1.1", "webpack": "^4.44.1", diff --git a/packages/livechat/tsconfig.json b/packages/livechat/tsconfig.json index dfa1e194f1b0..7779d5e46f4d 100644 --- a/packages/livechat/tsconfig.json +++ b/packages/livechat/tsconfig.json @@ -7,6 +7,9 @@ "allowJs": true, "checkJs": false, "noImplicitAny": true, + "jsx": "react-jsx", + "jsxImportSource": "preact", + "esModuleInterop": true, }, "exclude": [ "./node_modules", diff --git a/packages/livechat/tsconfig.typecheck.json b/packages/livechat/tsconfig.typecheck.json new file mode 100644 index 000000000000..6d236a812069 --- /dev/null +++ b/packages/livechat/tsconfig.typecheck.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "skipLibCheck": true, + "noEmit": true + }, + "exclude": [ "**/dist/**", "**/node_modules/**"] +} diff --git a/packages/livechat/webpack.config.js b/packages/livechat/webpack.config.js index 85eff1c5aca2..07eac760771a 100644 --- a/packages/livechat/webpack.config.js +++ b/packages/livechat/webpack.config.js @@ -44,7 +44,7 @@ module.exports = (env, argv) => [ }, { test: /\.tsx?$/, - use: 'ts-loader', + use: 'babel-loader', exclude: ['/node_modules/'], }, { @@ -234,7 +234,7 @@ module.exports = (env, argv) => [ }, { test: /\.tsx?$/, - use: 'ts-loader', + use: 'babel-loader', exclude: ['/node_modules/'], }, ], diff --git a/yarn.lock b/yarn.lock index 2bad4c8c8b39..0b10412a0b42 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5928,7 +5928,6 @@ __metadata: stylelint: ^14.9.1 stylelint-order: ^5.0.0 svg-loader: ^0.0.2 - ts-loader: ^8.4.0 typescript: ~4.5.5 url-loader: ^4.1.1 webpack: ^4.44.1 @@ -16291,7 +16290,7 @@ __metadata: languageName: node linkType: hard -"enhanced-resolve@npm:^4.0.0, enhanced-resolve@npm:^4.1.1, enhanced-resolve@npm:^4.5.0": +"enhanced-resolve@npm:^4.1.1, enhanced-resolve@npm:^4.5.0": version: 4.5.0 resolution: "enhanced-resolve@npm:4.5.0" dependencies: @@ -24764,7 +24763,7 @@ __metadata: languageName: node linkType: hard -"micromatch@npm:^4.0.0, micromatch@npm:^4.0.2, micromatch@npm:^4.0.4, micromatch@npm:^4.0.5": +"micromatch@npm:^4.0.2, micromatch@npm:^4.0.4, micromatch@npm:^4.0.5": version: 4.0.5 resolution: "micromatch@npm:4.0.5" dependencies: @@ -33764,22 +33763,6 @@ __metadata: languageName: node linkType: hard -"ts-loader@npm:^8.4.0": - version: 8.4.0 - resolution: "ts-loader@npm:8.4.0" - dependencies: - chalk: ^4.1.0 - enhanced-resolve: ^4.0.0 - loader-utils: ^2.0.0 - micromatch: ^4.0.0 - semver: ^7.3.4 - peerDependencies: - typescript: "*" - webpack: "*" - checksum: 79da0f364c013231bff28baede3f4f4081b1cca30b24df2d9f31a0517e0524eca2c8e4d438b853b1566a3a8eb9ff51ab0b36743346f0b3d5daa7001c98e5c738 - languageName: node - linkType: hard - "ts-node@npm:^10.9.1": version: 10.9.1 resolution: "ts-node@npm:10.9.1"