Skip to content

Commit cc9d467

Browse files
Split tsconfigs and disable type-checking for the test files
1 parent 649d31e commit cc9d467

File tree

7 files changed

+581
-223
lines changed

7 files changed

+581
-223
lines changed

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module.exports = {
2424
*/
2525
],
2626
transform: {
27-
'\\.(ts|tsx)?$': ['ts-jest'],
27+
'\\.(ts|tsx)?$': ['ts-jest', { diagnostics: false, tsconfig: 'tsconfig.test.json' }],
2828
'^.+\\.(js|jsx)?$': 'babel-jest',
2929
},
3030
transformIgnorePatterns: [],

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,10 @@
147147
"@babel/core": "^7.12.9",
148148
"@babel/node": "^7.12.6",
149149
"@babel/plugin-proposal-class-properties": "^7.12.1",
150-
"@babel/plugin-transform-runtime": "^7.12.1",
150+
"@babel/plugin-transform-runtime": "^7.28.5",
151151
"@babel/preset-env": "^7.12.7",
152-
"@babel/preset-react": "^7.23.3",
153-
"@babel/preset-typescript": "^7.12.7",
152+
"@babel/preset-react": "^7.28.5",
153+
"@babel/preset-typescript": "^7.28.5",
154154
"@breezystack/lamejs": "^1.2.7",
155155
"@commitlint/cli": "^18.4.3",
156156
"@commitlint/config-conventional": "^18.4.3",

tsconfig.json

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,7 @@
11
{
2-
"compilerOptions": {
3-
"lib": ["es2022", "dom"],
4-
"jsx": "react-jsx",
5-
"moduleResolution": "node",
6-
"module": "es2020",
7-
"target": "es2020",
8-
"allowSyntheticDefaultImports": true,
9-
"isolatedModules": true,
10-
"allowJs": true,
11-
"resolveJsonModule": true,
12-
"verbatimModuleSyntax": true,
13-
14-
"strict": true,
15-
"allowUnreachableCode": false,
16-
"forceConsistentCasingInFileNames": true,
17-
"noImplicitReturns": true,
18-
"noStrictGenericChecks": false,
19-
"noUnusedLocals": false,
20-
"noUnusedParameters": false,
21-
22-
"skipLibCheck": true,
23-
"noEmitOnError": true,
24-
"declaration": true,
25-
"emitDeclarationOnly": true,
26-
"declarationMap": true,
27-
"outDir": "./dist/types",
28-
"rootDir": "./src"
29-
},
30-
"include": ["./src"],
31-
"exclude": ["./src/stories", "./src/mock-builders", "./src/**/__tests__/*"]
2+
"files": [],
3+
"references": [
4+
{ "path": "./tsconfig.lib.json" },
5+
{ "path": "./tsconfig.test.json" }
6+
]
327
}

tsconfig.lib.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"compilerOptions": {
3+
"lib": ["es2022", "dom"],
4+
"jsx": "react-jsx",
5+
"moduleResolution": "node",
6+
"module": "es2020",
7+
"target": "es2020",
8+
"allowSyntheticDefaultImports": true,
9+
"isolatedModules": true,
10+
"allowJs": true,
11+
"resolveJsonModule": true,
12+
"verbatimModuleSyntax": true,
13+
14+
"strict": true,
15+
"allowUnreachableCode": false,
16+
"forceConsistentCasingInFileNames": true,
17+
"noImplicitReturns": true,
18+
"noStrictGenericChecks": false,
19+
"noUnusedLocals": false,
20+
"noUnusedParameters": false,
21+
22+
"skipLibCheck": true,
23+
"noEmitOnError": true,
24+
"declaration": true,
25+
"emitDeclarationOnly": true,
26+
"declarationMap": true,
27+
"outDir": "./dist/types",
28+
"rootDir": "./src"
29+
},
30+
"include": ["./src"],
31+
"exclude": ["./src/stories", "./src/mock-builders", "./src/**/__tests__"]
32+
}

tsconfig.test.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"compilerOptions": {
3+
"jsx": "react",
4+
"esModuleInterop": true,
5+
"allowJs": true
6+
},
7+
"include": ["src/**/__tests__/**/*.test.js"]
8+
}

vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { resolve } from 'path';
22
import { defineConfig } from 'vite';
33
import { name, dependencies, peerDependencies } from './package.json';
4-
import { compilerOptions } from './tsconfig.json';
4+
import { compilerOptions } from './tsconfig.lib.json';
55
import getPackageVersion from './scripts/get-package-version.mjs';
66

77
const external = [

0 commit comments

Comments
 (0)