Skip to content

Commit 106170a

Browse files
AlexJSullyCopilot
andauthored
Upgrade to TypeScript v6 (#580)
Update to TypeScript v6 and includes other package upgrades as well and necessary changes. --------- Co-authored-by: Copilot <copilot@github.com>
1 parent 380dcfa commit 106170a

14 files changed

Lines changed: 1065 additions & 2856 deletions

.github/copilot-instructions.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ NETWORK.SLOW_DOWNLINK_THRESHOLD; // Network performance checks
107107
- Tabs for indentation (indent: ['error', 'tab'])
108108
- Console logs allowed (`no-console: off`)
109109
- Unused vars with `_` prefix ignored
110-
- React hooks exhaustive deps enforced
111110

112111
### TypeScript
113112

eslint.config.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
const globals = require('globals');
2-
const react = require('eslint-plugin-react');
3-
const reactHooks = require('eslint-plugin-react-hooks');
42

53
module.exports = [
64
{
@@ -32,10 +30,6 @@ module.exports = [
3230
project: './tsconfig.json',
3331
},
3432
},
35-
plugins: {
36-
react,
37-
'react-hooks': reactHooks,
38-
},
3933
settings: {
4034
react: {
4135
version: 'detect',
@@ -52,14 +46,6 @@ module.exports = [
5246
'no-restricted-syntax': 'off',
5347
'no-unused-vars': ['error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
5448
radix: 'off',
55-
'react-hooks/rules-of-hooks': 'error',
56-
'react/forbid-prop-types': 'off',
57-
'react/jsx-filename-extension': ['error', { extensions: ['.tsx', '.jsx'] }],
58-
'react/jsx-props-no-spreading': 'off',
59-
'react/no-unknown-property': 'off',
60-
'react/react-in-jsx-scope': 'off',
61-
'react/require-default-props': ['error', { ignoreFunctionalComponents: true }],
62-
'react/static-property-placement': 'off',
6349
semi: ['error', 'always'],
6450
},
6551
},

jest.config.js

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
module.exports = {
2-
preset: 'ts-jest',
1+
const nextJest = require('next/jest');
2+
3+
const createJestConfig = nextJest({
4+
dir: './',
5+
});
6+
7+
const customJestConfig = {
38
moduleNameMapper: {
49
'^@$': '<rootDir>/src/index.ts',
510
'^@/(.*)$': '<rootDir>/src/$1',
@@ -21,6 +26,7 @@ module.exports = {
2126
'^@styles/(.*)$': '<rootDir>/src/styles/$1',
2227
'^@util$': '<rootDir>/src/util/index.ts',
2328
'^@util/(.*)$': '<rootDir>/src/util/$1',
29+
'^.+\\.(svg)$': '<rootDir>/jest/svg-mock.js',
2430
'\\.(css|less|scss|sass)$': 'jest-transform-stub',
2531
'\\.(svg|png|jpg|jpeg|gif|webp)$': '<rootDir>/jest/svg-mock.js',
2632
},
@@ -29,14 +35,6 @@ module.exports = {
2935
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
3036
testPathIgnorePatterns: ['/node_modules/', '/cypress/'],
3137
setupFilesAfterEnv: ['<rootDir>/jest/setup.ts'],
32-
transform: {
33-
'^.+\\.(ts|tsx)$': [
34-
'ts-jest',
35-
{
36-
tsconfig: {
37-
jsx: 'react-jsx',
38-
},
39-
},
40-
],
41-
},
4238
};
39+
40+
module.exports = createJestConfig(customJestConfig);

0 commit comments

Comments
 (0)