Skip to content

Commit

Permalink
Create a separate tsconfig file to specify jsx mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
rocketnova committed Jun 7, 2022
1 parent f6e8efe commit 9aee093
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 6 deletions.
7 changes: 6 additions & 1 deletion app/jest.config.js
Expand Up @@ -19,5 +19,10 @@ module.exports = {
testPathIgnorePatterns: [
"<rootDir>/node_modules/",
],
testRegex: "(/test/.*(test|spec))\\.[jt]sx?$"
testRegex: "(/test/.*(test|spec))\\.[jt]sx?$",
globals: {
'ts-jest': {
tsconfig: 'tsconfig.ts-jest.json'
}
}
};
23 changes: 18 additions & 5 deletions app/tsconfig.json
Expand Up @@ -2,10 +2,16 @@
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@pages/*": ["pages/*"]
"@pages/*": [
"pages/*"
]
},
"target": "es6",
"lib": ["dom", "dom.iterable", "esnext"],
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"checkJs": true,
"skipLibCheck": true,
Expand All @@ -17,9 +23,16 @@
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "react-jsx",
"jsx": "preserve",
"incremental": true
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "__mocks__/styleMock.js"],
"exclude": ["node_modules"]
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
"__mocks__/styleMock.js"
],
"exclude": [
"node_modules"
]
}
6 changes: 6 additions & 0 deletions app/tsconfig.ts-jest.json
@@ -0,0 +1,6 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"jsx": "react-jsx"
}
}

0 comments on commit 9aee093

Please sign in to comment.