From 9223b1e14460928fb4fd74d94dfa9a1acfed0370 Mon Sep 17 00:00:00 2001 From: Alejandro Lembke Barrientos Date: Sun, 21 Jun 2026 05:59:20 +0000 Subject: [PATCH] PR-733704: fix TypeScript errors in Cypress webpack build Add tsconfig.cy.json that extends the main tsconfig but removes the rootDir restriction and adds Cypress types. Point ts-loader in webpack.cy.config.ts to this dedicated tsconfig, fixing: - TS6059: cypress/support files outside rootDir src/components - TS2307: missing @storybook/react-webpack5 type declarations - TS2339: toBeInTheDocument not found (jest-dom types scope) --- tsconfig.cy.json | 13 +++++++++++++ webpack.cy.config.ts | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 tsconfig.cy.json diff --git a/tsconfig.cy.json b/tsconfig.cy.json new file mode 100644 index 0000000..3744f59 --- /dev/null +++ b/tsconfig.cy.json @@ -0,0 +1,13 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "rootDir": ".", + "noEmit": true, + "types": ["cypress", "node"] + }, + "include": [ + "src", + "cypress", + "src/@types" + ] +} diff --git a/webpack.cy.config.ts b/webpack.cy.config.ts index a3b0dbc..37683b7 100644 --- a/webpack.cy.config.ts +++ b/webpack.cy.config.ts @@ -50,7 +50,7 @@ export default { exclude: /node_modules/, use: { loader: 'ts-loader', - options: { transpileOnly: true }, + options: { configFile: 'tsconfig.cy.json' }, }, }, {