Skip to content

Commit

Permalink
chore(atomic): fix tsconfig resolution for the e2e folders (#4462)
Browse files Browse the repository at this point in the history
https://coveord.atlassian.net/browse/KIT-3604

In order to fix this problem, we have to tell the TS server to use
`"moduleResolution":"Bundler" & "module": "ES2022"` for the e2e/
folders. They are currently excluded in the atomic root tsconfig which
is why we get the error here.
<img width="1261" alt="image"
src="https://github.com/user-attachments/assets/a1956eda-a88b-4eb6-925d-c5d18cd8227f">

This is the solution I came up with, we would now have a tsconfig for
the IDE, a tsconfig for the stencil compilation, a tsconfig for the
storybook compilation and a tsconfig for playwright eslint rules 😅 . If
anyone has a better idea I am very open to it.
  • Loading branch information
alexprudhomme authored Sep 25, 2024
1 parent 944d8b2 commit 2a037ff
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 24 deletions.
1 change: 1 addition & 0 deletions packages/atomic/stencil.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ const isDevWatch: boolean =
process.argv.indexOf('--watch') > -1;

export const config: Config = {
tsconfig: 'tsconfig.stencil.json',
namespace: 'atomic',
taskQueue: 'async',
sourceMap: true,
Expand Down
26 changes: 2 additions & 24 deletions packages/atomic/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,10 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"declaration": false,
"experimentalDecorators": true,
"lib": ["dom", "ES2023", "ESNext.Collection"],
"moduleResolution": "Bundler",
"module": "ES2022",
"target": "ES2021",
"resolveJsonModule": true,
"useDefineForClassFields": false,
"noUnusedLocals": true,
"noUnusedParameters": true,
"jsx": "react",
"jsxFactory": "h"
},
"references": [
{
"path": "./tsconfig.storybook.json"
}
],
"include": ["src", "types/jsx.d.ts"],
"extends": "./tsconfig.stencil.json",
"exclude": [
"node_modules",
"src/external-builds",
"**/*.stories.tsx",
"**/*.stories.ts",
"**/*.stories.js",
"**/e2e/**/*"
"**/*.stories.js"
]
}
32 changes: 32 additions & 0 deletions packages/atomic/tsconfig.stencil.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"declaration": false,
"experimentalDecorators": true,
"lib": ["dom", "ES2023", "ESNext.Collection"],
"moduleResolution": "Bundler",
"module": "ES2022",
"target": "ES2021",
"resolveJsonModule": true,
"useDefineForClassFields": false,
"noUnusedLocals": true,
"noUnusedParameters": true,
"jsx": "react",
"jsxFactory": "h"
},
"references": [
{
"path": "./tsconfig.storybook.json"
}
],
"include": ["src", "types/jsx.d.ts"],
"exclude": [
"node_modules",
"src/external-builds",
"**/*.stories.tsx",
"**/*.stories.ts",
"**/*.stories.js",
"**/e2e/**/*"
]
}

0 comments on commit 2a037ff

Please sign in to comment.