Skip to content

Commit 8697286

Browse files
committed
fix: resolve build issues in create-tests branch
- Fix package.json: remove duplicate ESLint entries and move testing deps to devDependencies - Fix TypeScript configuration: remove @testing-library/jest-dom from global types - Remove Babel configuration to allow Next.js SWC compiler - Update Jest configuration to use ts-jest instead of babel-jest - Resolve ESLint and TypeScript compilation errors
1 parent ac5cec5 commit 8697286

File tree

5 files changed

+28
-29
lines changed

5 files changed

+28
-29
lines changed

.babelrc

Lines changed: 0 additions & 7 deletions
This file was deleted.

eslint.config.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
import { FlatCompat } from '@eslint/eslintrc';
2-
import js from '@eslint/js';
3-
import path from 'path';
4-
import { fileURLToPath } from 'url';
1+
import { FlatCompat } from '@eslint/eslintrc'
2+
import js from '@eslint/js'
3+
import path from 'path'
4+
import { fileURLToPath } from 'url'
55

6-
const __filename = fileURLToPath(import.meta.url);
7-
const __dirname = path.dirname(__filename);
6+
const __filename = fileURLToPath(import.meta.url)
7+
const __dirname = path.dirname(__filename)
88

99
const compat = new FlatCompat({
1010
baseDirectory: __dirname,
11-
recommendedConfig: js.configs.recommended,
12-
});
11+
recommendedConfig: js.configs.recommended
12+
})
1313

1414
export default [
1515
...compat.extends('next/core-web-vitals'),
1616
{
1717
rules: {
18-
'@typescript-eslint/no-explicit-any': 'warn',
19-
},
20-
},
21-
];
18+
'@typescript-eslint/no-explicit-any': 'warn'
19+
}
20+
}
21+
]

jest.config.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
export default {
22
testEnvironment: 'jsdom',
33
transform: {
4-
'^.+\\.(t|j)sx?$': 'babel-jest',
4+
'^.+\\.(t|j)sx?$': 'ts-jest',
55
},
66
moduleNameMapper: {
77
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
88
'^@/(.*)$': '<rootDir>/$1',
99
},
1010
setupFilesAfterEnv: ['<rootDir>/setupTests.ts'],
1111
testPathIgnorePatterns: ['/node_modules/', '/.next/'],
12+
preset: 'ts-jest',
13+
globals: {
14+
'ts-jest': {
15+
tsconfig: {
16+
jsx: 'react-jsx',
17+
},
18+
},
19+
},
1220
}

package.json

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,7 @@
1616
"@ant-design/icons": "^6.0.0",
1717
"@clerk/nextjs": "^4.31.5",
1818
"@clerk/themes": "^2.2.3",
19-
"@eslint/eslintrc": "^3.3.1",
2019
"@heroicons/react": "^2.0.18",
21-
"@jest/globals": "^29.7.0",
22-
"@testing-library/react": "^16.3.0",
23-
"expect": "^29.7.0",
2420
"framer-motion": "^12.0.0",
2521
"next": "^14.1.0",
2622
"react": "18.3.1",
@@ -31,19 +27,21 @@
3127
"@babel/preset-env": "^7.28.3",
3228
"@babel/preset-react": "^7.27.1",
3329
"@babel/preset-typescript": "^7.27.1",
30+
"@eslint/eslintrc": "^3.3.1",
31+
"@jest/globals": "^29.7.0",
3432
"@testing-library/jest-dom": "^6.9.1",
33+
"@testing-library/react": "^16.3.0",
3534
"@types/jest": "^30.0.0",
3635
"@types/node": "24.7.2",
3736
"@types/react": "18.3.12",
3837
"@types/react-dom": "18.3.1",
3938
"autoprefixer": "10.4.21",
4039
"babel-jest": "^29.7.0",
41-
"eslint": "9.37.0",
42-
"eslint-config-next": "15.5.5",
43-
"jest": "^29.7.0",
44-
"jest-environment-jsdom": "^29.7.0",
4540
"eslint": "9.38.0",
4641
"eslint-config-next": "15.5.6",
42+
"expect": "^29.7.0",
43+
"jest": "^29.7.0",
44+
"jest-environment-jsdom": "^29.7.0",
4745
"postcss": "8.5.6",
4846
"prettier": "^3.5.3",
4947
"prettier-plugin-tailwindcss": "^0.7.1",

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"isolatedModules": true,
1515
"jsx": "preserve",
1616
"incremental": true,
17-
"types": ["jest", "@testing-library/jest-dom"],
17+
"types": ["jest"],
1818
"typeRoots": ["./node_modules/@types", "./src/types"],
1919
"plugins": [
2020
{

0 commit comments

Comments
 (0)