From bc2df9a70511f2535b456a7d634a5f906db3cc74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=84=9D=EC=A7=84?= Date: Fri, 18 Oct 2024 22:57:29 +0900 Subject: [PATCH 1/9] chore(eslint-config): typescript-eslint 8 --- configs/eslint-config/eslint.config.mjs | 2 +- configs/eslint-config/package.json | 2 +- configs/eslint-config/src/index.ts | 8 +- configs/tsconfig/base.json | 3 +- .../tsconfig.json | 3 +- pnpm-lock.yaml | 230 +++++++++--------- 6 files changed, 124 insertions(+), 124 deletions(-) diff --git a/configs/eslint-config/eslint.config.mjs b/configs/eslint-config/eslint.config.mjs index 8748838c9..138314392 100644 --- a/configs/eslint-config/eslint.config.mjs +++ b/configs/eslint-config/eslint.config.mjs @@ -47,7 +47,7 @@ export default [ '@typescript-eslint/no-unsafe-member-access': 'warn', '@typescript-eslint/no-floating-promises': 'warn', '@typescript-eslint/no-unsafe-call': 'warn', - '@typescript-eslint/no-throw-literal': 'warn', + '@typescript-eslint/only-throw-error': 'warn', '@typescript-eslint/no-confusing-void-expression': 'off', '@typescript-eslint/restrict-template-expressions': 'off', '@typescript-eslint/no-empty-function': 'warn', diff --git a/configs/eslint-config/package.json b/configs/eslint-config/package.json index 235804fcb..d3f19958f 100644 --- a/configs/eslint-config/package.json +++ b/configs/eslint-config/package.json @@ -43,7 +43,7 @@ "eslint-plugin-prettier": "^5.2.1", "eslint-plugin-react-compiler": "0.0.0-experimental-9aef357-20240815", "eslint-plugin-react-hooks": "^4.6.2", - "typescript-eslint": "^7.18.0" + "typescript-eslint": "^8.9.0" }, "devDependencies": { "@suspensive/tsconfig": "workspace:*" diff --git a/configs/eslint-config/src/index.ts b/configs/eslint-config/src/index.ts index d06f32a69..21e738014 100644 --- a/configs/eslint-config/src/index.ts +++ b/configs/eslint-config/src/index.ts @@ -79,7 +79,7 @@ export const suspensiveTypeScriptConfig: ReturnType = ts '@typescript-eslint/no-unsafe-member-access': 'warn', '@typescript-eslint/no-floating-promises': 'warn', '@typescript-eslint/no-unsafe-call': 'warn', - '@typescript-eslint/no-throw-literal': 'warn', + '@typescript-eslint/only-throw-error': 'warn', '@typescript-eslint/no-confusing-void-expression': 'off', '@typescript-eslint/restrict-template-expressions': 'off', '@typescript-eslint/no-empty-function': 'warn', @@ -94,7 +94,7 @@ export const suspensiveTypeScriptConfig: ReturnType = ts rules: vitest.configs.recommended.rules, settings: { vitest: { typecheck: true } }, }, - jestDom.configs['flat/recommended'] as unknown as ReturnType[number], + jestDom.configs['flat/recommended'], { plugins: { import: importPlugin, @@ -113,14 +113,14 @@ export const suspensiveTypeScriptConfig: ReturnType = ts ], }, }, - eslintPluginPrettierRecommended as unknown as ReturnType[number] + eslintPluginPrettierRecommended ) export const suspensiveReactTypeScriptConfig: ReturnType = tseslint.config( ...suspensiveTypeScriptConfig, { files: ['**/*.{ts,tsx}'], - ...(pluginReact.configs.recommended as unknown as ReturnType[number]), + ...pluginReact.configs.recommended, ignores: ['**/*.mdx/**/*.{ts,tsx}'], }, { diff --git a/configs/tsconfig/base.json b/configs/tsconfig/base.json index 5fde1699c..ba333c374 100644 --- a/configs/tsconfig/base.json +++ b/configs/tsconfig/base.json @@ -15,7 +15,8 @@ "preserveWatchOutput": true, "skipLibCheck": true, "strict": true, - "resolveJsonModule": true + "resolveJsonModule": true, + "allowJs": true }, "exclude": ["dist", "esm", "build", "node_modules"] } diff --git a/examples/vite-react-18-suspense-prerender-siblings-problem/tsconfig.json b/examples/vite-react-18-suspense-prerender-siblings-problem/tsconfig.json index 83f72004d..4b7ba968d 100644 --- a/examples/vite-react-18-suspense-prerender-siblings-problem/tsconfig.json +++ b/examples/vite-react-18-suspense-prerender-siblings-problem/tsconfig.json @@ -18,7 +18,8 @@ "strict": true, "noUnusedLocals": true, "noUnusedParameters": true, - "noFallthroughCasesInSwitch": true + "noFallthroughCasesInSwitch": true, + "allowJs": true }, "include": ["src", "eslint.config.mjs", "vite.config.ts"] } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2b3c50deb..498f30858 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -202,13 +202,13 @@ importers: version: 14.2.15 '@vitest/eslint-plugin': specifier: ^1.1.4 - version: 1.1.4(@typescript-eslint/utils@8.8.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4))(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4)(vitest@2.1.1(@types/node@20.16.10)(@vitest/browser@2.1.1)(@vitest/ui@2.1.1)(jsdom@25.0.1)(msw@2.4.9(typescript@5.5.4))(terser@5.31.3)) + version: 1.1.4(@typescript-eslint/utils@8.9.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4))(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4)(vitest@2.1.1(@types/node@20.16.10)(@vitest/browser@2.1.1)(@vitest/ui@2.1.1)(jsdom@25.0.1)(msw@2.4.9(typescript@5.5.4))(terser@5.31.3)) eslint-config-prettier: specifier: ^9.1.0 version: 9.1.0(eslint@9.11.1(jiti@1.21.6)) eslint-plugin-import: specifier: ^2.30.0 - version: 2.30.0(@typescript-eslint/parser@7.18.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4))(eslint@9.11.1(jiti@1.21.6)) + version: 2.30.0(@typescript-eslint/parser@8.9.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4))(eslint@9.11.1(jiti@1.21.6)) eslint-plugin-jest-dom: specifier: ^5.4.0 version: 5.4.0(@testing-library/dom@10.4.0)(eslint@9.11.1(jiti@1.21.6)) @@ -228,8 +228,8 @@ importers: specifier: ^4.6.2 version: 4.6.2(eslint@9.11.1(jiti@1.21.6)) typescript-eslint: - specifier: ^7.18.0 - version: 7.18.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4) + specifier: ^8.9.0 + version: 8.9.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4) devDependencies: '@suspensive/tsconfig': specifier: workspace:* @@ -3704,47 +3704,46 @@ packages: '@types/yargs@17.0.32': resolution: {integrity: sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog==} - '@typescript-eslint/eslint-plugin@7.18.0': - resolution: {integrity: sha512-94EQTWZ40mzBc42ATNIBimBEDltSJ9RQHCC8vc/PDbxi4k8dVwUAv4o98dk50M1zB+JGFxp43FP7f8+FP8R6Sw==} - engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/eslint-plugin@8.9.0': + resolution: {integrity: sha512-Y1n621OCy4m7/vTXNlCbMVp87zSd7NH0L9cXD8aIpOaNlzeWxIK4+Q19A68gSmTNRZn92UjocVUWDthGxtqHFg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - '@typescript-eslint/parser': ^7.0.0 - eslint: ^8.56.0 + '@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0 + eslint: ^8.57.0 || ^9.0.0 typescript: '*' peerDependenciesMeta: typescript: optional: true - '@typescript-eslint/parser@7.18.0': - resolution: {integrity: sha512-4Z+L8I2OqhZV8qA132M4wNL30ypZGYOQVBfMgxDH/K5UX0PNqTu1c6za9ST5r9+tavvHiTWmBnKzpCJ/GlVFtg==} - engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/parser@8.9.0': + resolution: {integrity: sha512-U+BLn2rqTTHnc4FL3FJjxaXptTxmf9sNftJK62XLz4+GxG3hLHm/SUNaaXP5Y4uTiuYoL5YLy4JBCJe3+t8awQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: ^8.56.0 + eslint: ^8.57.0 || ^9.0.0 typescript: '*' peerDependenciesMeta: typescript: optional: true - '@typescript-eslint/scope-manager@7.18.0': - resolution: {integrity: sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==} - engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/scope-manager@8.8.0': resolution: {integrity: sha512-EL8eaGC6gx3jDd8GwEFEV091210U97J0jeEHrAYvIYosmEGet4wJ+g0SYmLu+oRiAwbSA5AVrt6DxLHfdd+bUg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/type-utils@7.18.0': - resolution: {integrity: sha512-XL0FJXuCLaDuX2sYqZUUSOJ2sG5/i1AAze+axqmLnSkNEVMVYLF+cbwlB2w8D1tinFuSikHmFta+P+HOofrLeA==} - engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/scope-manager@8.9.0': + resolution: {integrity: sha512-bZu9bUud9ym1cabmOYH9S6TnbWRzpklVmwqICeOulTCZ9ue2/pczWzQvt/cGj2r2o1RdKoZbuEMalJJSYw3pHQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@typescript-eslint/type-utils@8.8.0': + resolution: {integrity: sha512-IKwJSS7bCqyCeG4NVGxnOP6lLT9Okc3Zj8hLO96bpMkJab+10HIfJbMouLrlpyOr3yrQ1cA413YPFiGd1mW9/Q==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: ^8.56.0 typescript: '*' peerDependenciesMeta: typescript: optional: true - '@typescript-eslint/type-utils@8.8.0': - resolution: {integrity: sha512-IKwJSS7bCqyCeG4NVGxnOP6lLT9Okc3Zj8hLO96bpMkJab+10HIfJbMouLrlpyOr3yrQ1cA413YPFiGd1mW9/Q==} + '@typescript-eslint/type-utils@8.9.0': + resolution: {integrity: sha512-JD+/pCqlKqAk5961vxCluK+clkppHY07IbV3vett97KOV+8C6l+CPEPwpUuiMwgbOz/qrN3Ke4zzjqbT+ls+1Q==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '*' @@ -3752,25 +3751,25 @@ packages: typescript: optional: true - '@typescript-eslint/types@7.18.0': - resolution: {integrity: sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==} - engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/types@8.8.0': resolution: {integrity: sha512-QJwc50hRCgBd/k12sTykOJbESe1RrzmX6COk8Y525C9l7oweZ+1lw9JiU56im7Amm8swlz00DRIlxMYLizr2Vw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/typescript-estree@7.18.0': - resolution: {integrity: sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==} - engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/types@8.9.0': + resolution: {integrity: sha512-SjgkvdYyt1FAPhU9c6FiYCXrldwYYlIQLkuc+LfAhCna6ggp96ACncdtlbn8FmnG72tUkXclrDExOpEYf1nfJQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@typescript-eslint/typescript-estree@8.8.0': + resolution: {integrity: sha512-ZaMJwc/0ckLz5DaAZ+pNLmHv8AMVGtfWxZe/x2JVEkD5LnmhWiQMMcYT7IY7gkdJuzJ9P14fRy28lUrlDSWYdw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '*' peerDependenciesMeta: typescript: optional: true - '@typescript-eslint/typescript-estree@8.8.0': - resolution: {integrity: sha512-ZaMJwc/0ckLz5DaAZ+pNLmHv8AMVGtfWxZe/x2JVEkD5LnmhWiQMMcYT7IY7gkdJuzJ9P14fRy28lUrlDSWYdw==} + '@typescript-eslint/typescript-estree@8.9.0': + resolution: {integrity: sha512-9iJYTgKLDG6+iqegehc5+EqE6sqaee7kb8vWpmHZ86EqwDjmlqNNHeqDVqb9duh+BY6WCNHfIGvuVU3Tf9Db0g==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '*' @@ -3778,26 +3777,26 @@ packages: typescript: optional: true - '@typescript-eslint/utils@7.18.0': - resolution: {integrity: sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw==} - engines: {node: ^18.18.0 || >=20.0.0} - peerDependencies: - eslint: ^8.56.0 - '@typescript-eslint/utils@8.8.0': resolution: {integrity: sha512-QE2MgfOTem00qrlPgyByaCHay9yb1+9BjnMFnSFkUKQfu7adBXDTnCAivURnuPPAG/qiB+kzKkZKmKfaMT0zVg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 - '@typescript-eslint/visitor-keys@7.18.0': - resolution: {integrity: sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==} - engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/utils@8.9.0': + resolution: {integrity: sha512-PKgMmaSo/Yg/F7kIZvrgrWa1+Vwn036CdNUvYFEkYbPwOH4i8xvkaRlu148W3vtheWK9ckKRIz7PBP5oUlkrvQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 '@typescript-eslint/visitor-keys@8.8.0': resolution: {integrity: sha512-8mq51Lx6Hpmd7HnA2fcHQo3YgfX1qbccxQOgZcb4tvasu//zXRaA1j5ZRFeCw/VRAdFi4mRM9DnZw0Nu0Q2d1g==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@typescript-eslint/visitor-keys@8.9.0': + resolution: {integrity: sha512-Ht4y38ubk4L5/U8xKUBfKNYGmvKvA1CANoxiTRMM+tOLk3lbF3DvzZCxJCRSE+2GdCMSh6zq9VZJc3asc1XuAA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@typescript/vfs@1.6.0': resolution: {integrity: sha512-hvJUjNVeBMp77qPINuUvYXj4FyWeeMMKZkxEATEU3hqBAQ7qdTBCUFT7Sp0Zu0faeEtFf+ldXxMEDr/bk73ISg==} peerDependencies: @@ -10817,11 +10816,10 @@ packages: typedarray@0.0.6: resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} - typescript-eslint@7.18.0: - resolution: {integrity: sha512-PonBkP603E3tt05lDkbOMyaxJjvKqQrXsnow72sVeOFINDE/qNmnnd+f9b4N+U7W6MXnnYyrhtmF2t08QWwUbA==} - engines: {node: ^18.18.0 || >=20.0.0} + typescript-eslint@8.9.0: + resolution: {integrity: sha512-AuD/FXGYRQyqyOBCpNLldMlsCGvmDNxptQ3Dp58/NXeB+FqyvTfXmMyba3PYa0Vi9ybnj7G8S/yd/4Cw8y47eA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: ^8.56.0 typescript: '*' peerDependenciesMeta: typescript: @@ -13547,7 +13545,7 @@ snapshots: '@babel/parser': 7.25.0 '@babel/template': 7.25.0 '@babel/types': 7.25.0 - debug: 4.3.5 + debug: 4.3.6 globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -14379,9 +14377,9 @@ snapshots: dependencies: '@eslint-react/tools': 1.14.3 '@eslint-react/types': 1.14.3(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4) - '@typescript-eslint/types': 8.8.0 - '@typescript-eslint/typescript-estree': 8.8.0(typescript@5.5.4) - '@typescript-eslint/utils': 8.8.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4) + '@typescript-eslint/types': 8.9.0 + '@typescript-eslint/typescript-estree': 8.9.0(typescript@5.5.4) + '@typescript-eslint/utils': 8.9.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4) birecord: 0.1.1 string-ts: 2.2.0 ts-pattern: 5.4.0 @@ -14398,10 +14396,10 @@ snapshots: '@eslint-react/tools': 1.14.3 '@eslint-react/types': 1.14.3(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4) '@eslint-react/var': 1.14.3(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4) - '@typescript-eslint/scope-manager': 8.8.0 - '@typescript-eslint/type-utils': 8.8.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4) - '@typescript-eslint/types': 8.8.0 - '@typescript-eslint/utils': 8.8.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4) + '@typescript-eslint/scope-manager': 8.9.0 + '@typescript-eslint/type-utils': 8.9.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4) + '@typescript-eslint/types': 8.9.0 + '@typescript-eslint/utils': 8.9.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4) birecord: 0.1.1 short-unique-id: 5.2.0 ts-pattern: 5.4.0 @@ -14437,9 +14435,9 @@ snapshots: '@eslint-react/tools': 1.14.3 '@eslint-react/types': 1.14.3(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4) '@eslint-react/var': 1.14.3(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4) - '@typescript-eslint/scope-manager': 8.8.0 - '@typescript-eslint/types': 8.8.0 - '@typescript-eslint/utils': 8.8.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4) + '@typescript-eslint/scope-manager': 8.9.0 + '@typescript-eslint/types': 8.9.0 + '@typescript-eslint/utils': 8.9.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4) ts-pattern: 5.4.0 transitivePeerDependencies: - eslint @@ -14473,9 +14471,9 @@ snapshots: '@eslint-react/ast': 1.14.3(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4) '@eslint-react/tools': 1.14.3 '@eslint-react/types': 1.14.3(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4) - '@typescript-eslint/scope-manager': 8.8.0 - '@typescript-eslint/types': 8.8.0 - '@typescript-eslint/utils': 8.8.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4) + '@typescript-eslint/scope-manager': 8.9.0 + '@typescript-eslint/types': 8.9.0 + '@typescript-eslint/utils': 8.9.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4) ts-pattern: 5.4.0 transitivePeerDependencies: - eslint @@ -16618,14 +16616,14 @@ snapshots: dependencies: '@types/yargs-parser': 21.0.3 - '@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4))(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4)': + '@typescript-eslint/eslint-plugin@8.9.0(@typescript-eslint/parser@8.9.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4))(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4)': dependencies: '@eslint-community/regexpp': 4.11.0 - '@typescript-eslint/parser': 7.18.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4) - '@typescript-eslint/scope-manager': 7.18.0 - '@typescript-eslint/type-utils': 7.18.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4) - '@typescript-eslint/utils': 7.18.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4) - '@typescript-eslint/visitor-keys': 7.18.0 + '@typescript-eslint/parser': 8.9.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4) + '@typescript-eslint/scope-manager': 8.9.0 + '@typescript-eslint/type-utils': 8.9.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4) + '@typescript-eslint/utils': 8.9.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4) + '@typescript-eslint/visitor-keys': 8.9.0 eslint: 9.11.1(jiti@1.21.6) graphemer: 1.4.0 ignore: 5.3.1 @@ -16636,12 +16634,12 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@7.18.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4)': + '@typescript-eslint/parser@8.9.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4)': dependencies: - '@typescript-eslint/scope-manager': 7.18.0 - '@typescript-eslint/types': 7.18.0 - '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.5.4) - '@typescript-eslint/visitor-keys': 7.18.0 + '@typescript-eslint/scope-manager': 8.9.0 + '@typescript-eslint/types': 8.9.0 + '@typescript-eslint/typescript-estree': 8.9.0(typescript@5.5.4) + '@typescript-eslint/visitor-keys': 8.9.0 debug: 4.3.6 eslint: 9.11.1(jiti@1.21.6) optionalDependencies: @@ -16649,32 +16647,32 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/scope-manager@7.18.0': - dependencies: - '@typescript-eslint/types': 7.18.0 - '@typescript-eslint/visitor-keys': 7.18.0 - '@typescript-eslint/scope-manager@8.8.0': dependencies: '@typescript-eslint/types': 8.8.0 '@typescript-eslint/visitor-keys': 8.8.0 - '@typescript-eslint/type-utils@7.18.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4)': + '@typescript-eslint/scope-manager@8.9.0': + dependencies: + '@typescript-eslint/types': 8.9.0 + '@typescript-eslint/visitor-keys': 8.9.0 + + '@typescript-eslint/type-utils@8.8.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4)': dependencies: - '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.5.4) - '@typescript-eslint/utils': 7.18.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4) + '@typescript-eslint/typescript-estree': 8.8.0(typescript@5.5.4) + '@typescript-eslint/utils': 8.8.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4) debug: 4.3.6 - eslint: 9.11.1(jiti@1.21.6) ts-api-utils: 1.3.0(typescript@5.5.4) optionalDependencies: typescript: 5.5.4 transitivePeerDependencies: + - eslint - supports-color - '@typescript-eslint/type-utils@8.8.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4)': + '@typescript-eslint/type-utils@8.9.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4)': dependencies: - '@typescript-eslint/typescript-estree': 8.8.0(typescript@5.5.4) - '@typescript-eslint/utils': 8.8.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4) + '@typescript-eslint/typescript-estree': 8.9.0(typescript@5.5.4) + '@typescript-eslint/utils': 8.9.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4) debug: 4.3.6 ts-api-utils: 1.3.0(typescript@5.5.4) optionalDependencies: @@ -16683,16 +16681,16 @@ snapshots: - eslint - supports-color - '@typescript-eslint/types@7.18.0': {} - '@typescript-eslint/types@8.8.0': {} - '@typescript-eslint/typescript-estree@7.18.0(typescript@5.5.4)': + '@typescript-eslint/types@8.9.0': {} + + '@typescript-eslint/typescript-estree@8.8.0(typescript@5.5.4)': dependencies: - '@typescript-eslint/types': 7.18.0 - '@typescript-eslint/visitor-keys': 7.18.0 + '@typescript-eslint/types': 8.8.0 + '@typescript-eslint/visitor-keys': 8.8.0 debug: 4.3.6 - globby: 11.1.0 + fast-glob: 3.3.2 is-glob: 4.0.3 minimatch: 9.0.5 semver: 7.6.3 @@ -16702,10 +16700,10 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/typescript-estree@8.8.0(typescript@5.5.4)': + '@typescript-eslint/typescript-estree@8.9.0(typescript@5.5.4)': dependencies: - '@typescript-eslint/types': 8.8.0 - '@typescript-eslint/visitor-keys': 8.8.0 + '@typescript-eslint/types': 8.9.0 + '@typescript-eslint/visitor-keys': 8.9.0 debug: 4.3.6 fast-glob: 3.3.2 is-glob: 4.0.3 @@ -16717,36 +16715,36 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@7.18.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4)': + '@typescript-eslint/utils@8.8.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4)': dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@9.11.1(jiti@1.21.6)) - '@typescript-eslint/scope-manager': 7.18.0 - '@typescript-eslint/types': 7.18.0 - '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.5.4) + '@typescript-eslint/scope-manager': 8.8.0 + '@typescript-eslint/types': 8.8.0 + '@typescript-eslint/typescript-estree': 8.8.0(typescript@5.5.4) eslint: 9.11.1(jiti@1.21.6) transitivePeerDependencies: - supports-color - typescript - '@typescript-eslint/utils@8.8.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4)': + '@typescript-eslint/utils@8.9.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4)': dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@9.11.1(jiti@1.21.6)) - '@typescript-eslint/scope-manager': 8.8.0 - '@typescript-eslint/types': 8.8.0 - '@typescript-eslint/typescript-estree': 8.8.0(typescript@5.5.4) + '@typescript-eslint/scope-manager': 8.9.0 + '@typescript-eslint/types': 8.9.0 + '@typescript-eslint/typescript-estree': 8.9.0(typescript@5.5.4) eslint: 9.11.1(jiti@1.21.6) transitivePeerDependencies: - supports-color - typescript - '@typescript-eslint/visitor-keys@7.18.0': + '@typescript-eslint/visitor-keys@8.8.0': dependencies: - '@typescript-eslint/types': 7.18.0 + '@typescript-eslint/types': 8.8.0 eslint-visitor-keys: 3.4.3 - '@typescript-eslint/visitor-keys@8.8.0': + '@typescript-eslint/visitor-keys@8.9.0': dependencies: - '@typescript-eslint/types': 8.8.0 + '@typescript-eslint/types': 8.9.0 eslint-visitor-keys: 3.4.3 '@typescript/vfs@1.6.0(typescript@5.5.4)': @@ -16838,11 +16836,11 @@ snapshots: transitivePeerDependencies: - supports-color - '@vitest/eslint-plugin@1.1.4(@typescript-eslint/utils@8.8.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4))(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4)(vitest@2.1.1(@types/node@20.16.10)(@vitest/browser@2.1.1)(@vitest/ui@2.1.1)(jsdom@25.0.1)(msw@2.4.9(typescript@5.5.4))(terser@5.31.3))': + '@vitest/eslint-plugin@1.1.4(@typescript-eslint/utils@8.9.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4))(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4)(vitest@2.1.1(@types/node@20.16.10)(@vitest/browser@2.1.1)(@vitest/ui@2.1.1)(jsdom@25.0.1)(msw@2.4.9(typescript@5.5.4))(terser@5.31.3))': dependencies: eslint: 9.11.1(jiti@1.21.6) optionalDependencies: - '@typescript-eslint/utils': 8.8.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4) + '@typescript-eslint/utils': 8.9.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4) typescript: 5.5.4 vitest: 2.1.1(@types/node@20.16.10)(@vitest/browser@2.1.1)(@vitest/ui@2.1.1)(jsdom@25.0.1)(msw@2.4.9(typescript@5.5.4))(terser@5.31.3) @@ -19059,17 +19057,17 @@ snapshots: - bluebird - supports-color - eslint-module-utils@2.12.0(@typescript-eslint/parser@7.18.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint@9.11.1(jiti@1.21.6)): + eslint-module-utils@2.12.0(@typescript-eslint/parser@8.9.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint@9.11.1(jiti@1.21.6)): dependencies: debug: 3.2.7 optionalDependencies: - '@typescript-eslint/parser': 7.18.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4) + '@typescript-eslint/parser': 8.9.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4) eslint: 9.11.1(jiti@1.21.6) eslint-import-resolver-node: 0.3.9 transitivePeerDependencies: - supports-color - eslint-plugin-import@2.30.0(@typescript-eslint/parser@7.18.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4))(eslint@9.11.1(jiti@1.21.6)): + eslint-plugin-import@2.30.0(@typescript-eslint/parser@8.9.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4))(eslint@9.11.1(jiti@1.21.6)): dependencies: '@rtsao/scc': 1.1.0 array-includes: 3.1.8 @@ -19080,7 +19078,7 @@ snapshots: doctrine: 2.1.0 eslint: 9.11.1(jiti@1.21.6) eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.12.0(@typescript-eslint/parser@7.18.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint@9.11.1(jiti@1.21.6)) + eslint-module-utils: 2.12.0(@typescript-eslint/parser@8.9.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint@9.11.1(jiti@1.21.6)) hasown: 2.0.2 is-core-module: 2.15.1 is-glob: 4.0.3 @@ -19091,7 +19089,7 @@ snapshots: semver: 6.3.1 tsconfig-paths: 3.15.0 optionalDependencies: - '@typescript-eslint/parser': 7.18.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4) + '@typescript-eslint/parser': 8.9.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4) transitivePeerDependencies: - eslint-import-resolver-typescript - eslint-import-resolver-webpack @@ -20654,7 +20652,7 @@ snapshots: is-immutable-type@5.0.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4): dependencies: - '@typescript-eslint/type-utils': 8.8.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4) + '@typescript-eslint/type-utils': 8.9.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4) eslint: 9.11.1(jiti@1.21.6) ts-api-utils: 1.3.0(typescript@5.5.4) ts-declaration-location: 1.0.4(typescript@5.5.4) @@ -25351,15 +25349,15 @@ snapshots: typedarray@0.0.6: {} - typescript-eslint@7.18.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4): + typescript-eslint@8.9.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4): dependencies: - '@typescript-eslint/eslint-plugin': 7.18.0(@typescript-eslint/parser@7.18.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4))(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4) - '@typescript-eslint/parser': 7.18.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4) - '@typescript-eslint/utils': 7.18.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4) - eslint: 9.11.1(jiti@1.21.6) + '@typescript-eslint/eslint-plugin': 8.9.0(@typescript-eslint/parser@8.9.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4))(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4) + '@typescript-eslint/parser': 8.9.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4) + '@typescript-eslint/utils': 8.9.0(eslint@9.11.1(jiti@1.21.6))(typescript@5.5.4) optionalDependencies: typescript: 5.5.4 transitivePeerDependencies: + - eslint - supports-color typescript@5.3.3: {} From d996c7b528c3e83fcfa36bf0369ac004c0d5ff90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=84=9D=EC=A7=84?= Date: Sat, 19 Oct 2024 14:24:07 +0900 Subject: [PATCH 2/9] fix(*): eslint error --- .../src/App.tsx | 1 + packages/jotai/src/Atom.test-d.tsx | 42 +++++++++++-------- packages/jotai/src/AtomValue.test-d.tsx | 42 +++++++++++-------- packages/jotai/src/SetAtom.test-d.tsx | 21 ++++++---- packages/react-dom/src/test-utils/index.ts | 3 +- .../react-query-4/src/Mutation.test-d.tsx | 6 +-- .../src/PrefetchInfiniteQuery.test-d.tsx | 30 ++++++------- .../src/PrefetchQuery.test-d.tsx | 28 ++++++------- .../src/QueryClientConsumer.test-d.tsx | 12 +++--- .../src/SuspenseInfiniteQuery.test-d.tsx | 42 ++++++++++--------- .../src/SuspenseQueries.test-d.tsx | 10 ++--- .../src/SuspenseQuery.test-d.tsx | 40 +++++++++--------- .../src/useSuspenseInfiniteQuery.test-d.ts | 1 + .../src/useSuspenseQuery.test-d.ts | 1 + .../src/utility-types/OmitKeyof.test-d.ts | 1 + .../react-query-5/src/Mutation.test-d.tsx | 6 +-- .../src/PrefetchInfiniteQuery.test-d.tsx | 30 ++++++------- .../src/PrefetchQuery.test-d.tsx | 30 ++++++------- .../src/QueryClientConsumer.test-d.tsx | 12 +++--- .../src/SuspenseInfiniteQuery.test-d.tsx | 30 ++++++------- .../src/SuspenseQueries.test-d.tsx | 14 +++---- .../src/SuspenseQuery.test-d.tsx | 30 ++++++------- .../react-query/src/scripts/utils/copy.ts | 2 +- .../react-query/src/scripts/utils/package.ts | 4 +- .../src/scripts/utils/switchVersion.spec.ts | 5 ++- packages/react/src/Delay.test-d.tsx | 6 +-- packages/react/src/DevMode.spec.tsx | 5 ++- packages/react/src/ErrorBoundary.test-d.tsx | 2 +- packages/react/src/ErrorBoundary.tsx | 2 +- .../react/src/ErrorBoundaryGroup.test-d.tsx | 4 +- packages/react/src/Suspensive.spec.tsx | 15 +++++++ packages/react/src/Suspensive.tsx | 5 +++ packages/react/src/hooks/useIsClient.spec.ts | 4 ++ .../src/hooks/usePreservedCallback.test-d.ts | 15 ++----- .../src/utility-types/OmitKeyof.test-d.ts | 1 + packages/react/src/utils/defineSuspense.tsx | 2 +- 36 files changed, 275 insertions(+), 229 deletions(-) diff --git a/examples/vite-react-18-suspense-prerender-siblings-problem/src/App.tsx b/examples/vite-react-18-suspense-prerender-siblings-problem/src/App.tsx index ae1934d5d..26ea1fe29 100644 --- a/examples/vite-react-18-suspense-prerender-siblings-problem/src/App.tsx +++ b/examples/vite-react-18-suspense-prerender-siblings-problem/src/App.tsx @@ -50,6 +50,7 @@ const query = { queryKey: ['dummy', ms], queryFn: async () => { console.log({ fetch: `fetch${ms + 1}` }) + // eslint-disable-next-line @typescript-eslint/no-unsafe-return return fetch(`https://dummyjson.com/users/${ms + 1}`).then((res) => res.json()) }, }), diff --git a/packages/jotai/src/Atom.test-d.tsx b/packages/jotai/src/Atom.test-d.tsx index e49498445..db5d2be8a 100644 --- a/packages/jotai/src/Atom.test-d.tsx +++ b/packages/jotai/src/Atom.test-d.tsx @@ -15,72 +15,78 @@ const loadableAtom = loadable(asyncAtom) describe('', () => { it('type check', () => { - ;() => ( + ;(() => ( {(result) => { + // eslint-disable-next-line @typescript-eslint/no-unused-vars const returnOfJotai = useAtom(countAtom) expectTypeOf(result).toEqualTypeOf() return <> }} - ) - ;() => ( + ))() + ;(() => ( {(result) => { + // eslint-disable-next-line @typescript-eslint/no-unused-vars const returnOfJotai = useAtom(readOnlyCountAtom) expectTypeOf(result).toEqualTypeOf() return <> }} - ) - ;() => ( + ))() + ;(() => ( {(result) => { + // eslint-disable-next-line @typescript-eslint/no-unused-vars const returnOfJotai = useAtom(writeOnlyCountAtom) expectTypeOf(result).toEqualTypeOf() return <> }} - ) - ;() => ( + ))() + ;(() => ( {(result) => { + // eslint-disable-next-line @typescript-eslint/no-unused-vars const returnOfJotai = useAtom(asyncAtom) expectTypeOf(result).toEqualTypeOf() return <> }} - ) - ;() => ( + ))() + ;(() => ( {(result) => { + // eslint-disable-next-line @typescript-eslint/no-unused-vars const returnOfJotai = useAtom(asyncIncrementAtom) expectTypeOf(result).toEqualTypeOf() return <> }} - ) - ;() => ( + ))() + ;(() => ( {(result) => { + // eslint-disable-next-line @typescript-eslint/no-unused-vars const returnOfJotai = useAtom(loadableAtom) expectTypeOf(result).toEqualTypeOf() return <> }} - ) + ))() - expectTypeOf({() => <>}).toEqualTypeOf() + expectTypeOf({() => <>}).toEqualTypeOf() expectTypeOf({() => <>}).not.toEqualTypeOf() - expectTypeOf({() => <>}).toEqualTypeOf() + expectTypeOf({() => <>}).toEqualTypeOf() expectTypeOf({() => <>}).not.toEqualTypeOf() - expectTypeOf({() => <>}).toEqualTypeOf() + expectTypeOf({() => <>}).toEqualTypeOf() expectTypeOf({() => <>}).not.toEqualTypeOf() - expectTypeOf({() => <>}).toEqualTypeOf() + expectTypeOf({() => <>}).toEqualTypeOf() expectTypeOf({() => <>}).not.toEqualTypeOf() - expectTypeOf({() => <>}).toEqualTypeOf() + expectTypeOf({() => <>}).toEqualTypeOf() expectTypeOf({() => <>}).not.toEqualTypeOf() - expectTypeOf({() => <>}).toEqualTypeOf() + expectTypeOf({() => <>}).toEqualTypeOf() expectTypeOf({() => <>}).not.toEqualTypeOf() }) }) diff --git a/packages/jotai/src/AtomValue.test-d.tsx b/packages/jotai/src/AtomValue.test-d.tsx index 3bbd9ad84..a5bbe2041 100644 --- a/packages/jotai/src/AtomValue.test-d.tsx +++ b/packages/jotai/src/AtomValue.test-d.tsx @@ -15,72 +15,78 @@ const loadableAtom = loadable(asyncAtom) describe('', () => { it('type check', () => { - ;() => ( + ;(() => ( {(value) => { + // eslint-disable-next-line @typescript-eslint/no-unused-vars const valueOfJotai = useAtomValue(countAtom) expectTypeOf(value).toEqualTypeOf() return <> }} - ) - ;() => ( + ))() + ;(() => ( {(value) => { + // eslint-disable-next-line @typescript-eslint/no-unused-vars const valueOfJotai = useAtomValue(readOnlyCountAtom) expectTypeOf(value).toEqualTypeOf() return <> }} - ) - ;() => ( + ))() + ;(() => ( {(value) => { + // eslint-disable-next-line @typescript-eslint/no-unused-vars const valueOfJotai = useAtomValue(writeOnlyCountAtom) expectTypeOf(value).toEqualTypeOf() return <> }} - ) - ;() => ( + ))() + ;(() => ( {(value) => { + // eslint-disable-next-line @typescript-eslint/no-unused-vars const valueOfJotai = useAtomValue(asyncAtom) expectTypeOf(value).toEqualTypeOf() return <> }} - ) - ;() => ( + ))() + ;(() => ( {(value) => { + // eslint-disable-next-line @typescript-eslint/no-unused-vars const valueOfJotai = useAtomValue(asyncIncrementAtom) expectTypeOf(value).toEqualTypeOf() return <> }} - ) - ;() => ( + ))() + ;(() => ( {(value) => { + // eslint-disable-next-line @typescript-eslint/no-unused-vars const valueOfJotai = useAtomValue(loadableAtom) expectTypeOf(value).toEqualTypeOf() return <> }} - ) + ))() - expectTypeOf({() => <>}).toEqualTypeOf() + expectTypeOf({() => <>}).toEqualTypeOf() expectTypeOf({() => <>}).not.toEqualTypeOf() - expectTypeOf({() => <>}).toEqualTypeOf() + expectTypeOf({() => <>}).toEqualTypeOf() expectTypeOf({() => <>}).not.toEqualTypeOf() - expectTypeOf({() => <>}).toEqualTypeOf() + expectTypeOf({() => <>}).toEqualTypeOf() expectTypeOf({() => <>}).not.toEqualTypeOf() - expectTypeOf({() => <>}).toEqualTypeOf() + expectTypeOf({() => <>}).toEqualTypeOf() expectTypeOf({() => <>}).not.toEqualTypeOf() - expectTypeOf({() => <>}).toEqualTypeOf() + expectTypeOf({() => <>}).toEqualTypeOf() expectTypeOf({() => <>}).not.toEqualTypeOf() - expectTypeOf({() => <>}).toEqualTypeOf() + expectTypeOf({() => <>}).toEqualTypeOf() expectTypeOf({() => <>}).not.toEqualTypeOf() }) }) diff --git a/packages/jotai/src/SetAtom.test-d.tsx b/packages/jotai/src/SetAtom.test-d.tsx index 1d8e58e4c..55898ec57 100644 --- a/packages/jotai/src/SetAtom.test-d.tsx +++ b/packages/jotai/src/SetAtom.test-d.tsx @@ -11,39 +11,42 @@ const asyncIncrementAtom = atom(null, async (get, set) => { describe('', () => { it('type check', () => { - ;() => ( + ;(() => ( {(value) => { + // eslint-disable-next-line @typescript-eslint/no-unused-vars const valueOfJotai = useSetAtom(countAtom) expectTypeOf(value).toEqualTypeOf() return <> }} - ) - ;() => ( + ))() + ;(() => ( {(value) => { + // eslint-disable-next-line @typescript-eslint/no-unused-vars const valueOfJotai = useSetAtom(writeOnlyCountAtom) expectTypeOf(value).toEqualTypeOf() return <> }} - ) - ;() => ( + ))() + ;(() => ( {(value) => { + // eslint-disable-next-line @typescript-eslint/no-unused-vars const valueOfJotai = useSetAtom(asyncIncrementAtom) expectTypeOf(value).toEqualTypeOf() return <> }} - ) + ))() - expectTypeOf({() => <>}).toEqualTypeOf() + expectTypeOf({() => <>}).toEqualTypeOf() expectTypeOf({() => <>}).not.toEqualTypeOf() - expectTypeOf({() => <>}).toEqualTypeOf() + expectTypeOf({() => <>}).toEqualTypeOf() expectTypeOf({() => <>}).not.toEqualTypeOf() - expectTypeOf({() => <>}).toEqualTypeOf() + expectTypeOf({() => <>}).toEqualTypeOf() expectTypeOf({() => <>}).not.toEqualTypeOf() }) }) diff --git a/packages/react-dom/src/test-utils/index.ts b/packages/react-dom/src/test-utils/index.ts index 59a4805a6..a09ab902e 100644 --- a/packages/react-dom/src/test-utils/index.ts +++ b/packages/react-dom/src/test-utils/index.ts @@ -1,5 +1,4 @@ import * as React from 'react' -import * as DeprecatedReactTestUtils from 'react-dom/test-utils' declare global { // eslint-disable-next-line no-var @@ -8,7 +7,7 @@ declare global { var jest: { fn: typeof vi.fn } | undefined } -const act = typeof React.act === 'function' ? React.act : DeprecatedReactTestUtils.act +const act = React.act type Item = { callback: IntersectionObserverCallback diff --git a/packages/react-query-4/src/Mutation.test-d.tsx b/packages/react-query-4/src/Mutation.test-d.tsx index 785ae9b1f..6695eac36 100644 --- a/packages/react-query-4/src/Mutation.test-d.tsx +++ b/packages/react-query-4/src/Mutation.test-d.tsx @@ -7,16 +7,16 @@ const mutationFn = () => Promise.resolve(5) describe('', () => { it('type check', () => { - ;() => ( + ;(() => ( {(mutation) => { expectTypeOf(mutation).toEqualTypeOf>() return <> }} - ) + ))() - expectTypeOf({() => <>}).toEqualTypeOf() + expectTypeOf({() => <>}).toEqualTypeOf() expectTypeOf({() => <>}).not.toEqualTypeOf() }) }) diff --git a/packages/react-query-4/src/PrefetchInfiniteQuery.test-d.tsx b/packages/react-query-4/src/PrefetchInfiniteQuery.test-d.tsx index 24a48f6f7..3706c4c9a 100644 --- a/packages/react-query-4/src/PrefetchInfiniteQuery.test-d.tsx +++ b/packages/react-query-4/src/PrefetchInfiniteQuery.test-d.tsx @@ -6,55 +6,57 @@ import { queryFn, queryKey } from './test-utils' describe('', () => { it('type check', () => { - ;() => ( + ;(() => ( - ) - ;() => ( + ))() + ;(() => ( - ) - ;() => ( + ))() + ;(() => ( - ) - ;() => ( + ))() + ;(() => ( - ) - ;() => ( + ))() + ;(() => ( - ) - ;() => + ))() + ;(() => )() const options = infiniteQueryOptions({ queryKey, queryFn, }) - ;() => - expectTypeOf().toEqualTypeOf() + ;(() => )() + expectTypeOf().toEqualTypeOf() expectTypeOf().not.toEqualTypeOf() - expectTypeOf({() => <>}).toEqualTypeOf() + expectTypeOf( + {() => <>} + ).toEqualTypeOf() expectTypeOf( {() => <>} ).not.toEqualTypeOf() diff --git a/packages/react-query-4/src/PrefetchQuery.test-d.tsx b/packages/react-query-4/src/PrefetchQuery.test-d.tsx index 62f4b6d99..456b17dea 100644 --- a/packages/react-query-4/src/PrefetchQuery.test-d.tsx +++ b/packages/react-query-4/src/PrefetchQuery.test-d.tsx @@ -6,55 +6,55 @@ import { queryFn, queryKey } from './test-utils' describe('', () => { it('type check', () => { - ;() => ( + ;(() => ( - ) - ;() => ( + ))() + ;(() => ( - ) - ;() => ( + ))() + ;(() => ( - ) - ;() => ( + ))() + ;(() => ( - ) - ;() => ( + ))() + ;(() => ( - ) - ;() => + ))() + ;(() => )() const options = queryOptions({ queryKey, queryFn, }) - ;() => - expectTypeOf().toEqualTypeOf() + ;(() => )() + expectTypeOf().toEqualTypeOf() expectTypeOf().not.toEqualTypeOf() - expectTypeOf({() => <>}).toEqualTypeOf() + expectTypeOf({() => <>}).toEqualTypeOf() expectTypeOf({() => <>}).not.toEqualTypeOf() }) }) diff --git a/packages/react-query-4/src/QueryClientConsumer.test-d.tsx b/packages/react-query-4/src/QueryClientConsumer.test-d.tsx index dea7cbab2..3f9619b68 100644 --- a/packages/react-query-4/src/QueryClientConsumer.test-d.tsx +++ b/packages/react-query-4/src/QueryClientConsumer.test-d.tsx @@ -6,27 +6,27 @@ const reactQueryContext = createContext(new QueryClient describe('', () => { it('type check', () => { - ;() => ( + ;(() => ( {(queryClient) => { expectTypeOf(queryClient).toEqualTypeOf() return <> }} - ) - ;() => ( + ))() + ;(() => ( {(queryClient) => { expectTypeOf(queryClient).toEqualTypeOf() return <> }} - ) - expectTypeOf({() => <>}).toEqualTypeOf() + ))() + expectTypeOf({() => <>}).toEqualTypeOf() expectTypeOf({() => <>}).not.toEqualTypeOf() expectTypeOf( {() => <>} - ).toEqualTypeOf() + ).toEqualTypeOf() expectTypeOf( {() => <>} ).not.toEqualTypeOf() diff --git a/packages/react-query-4/src/SuspenseInfiniteQuery.test-d.tsx b/packages/react-query-4/src/SuspenseInfiniteQuery.test-d.tsx index a54c3e429..1e3d2f309 100644 --- a/packages/react-query-4/src/SuspenseInfiniteQuery.test-d.tsx +++ b/packages/react-query-4/src/SuspenseInfiniteQuery.test-d.tsx @@ -8,7 +8,7 @@ import type { UseSuspenseInfiniteQueryResult } from './useSuspenseInfiniteQuery' describe('', () => { it('type check', () => { - ;() => ( + ;(() => ( ', () => { > {(query) => <>{query.data.pages.filter(({ text }) => text)}} - ) - ;() => ( + ))() + ;(() => ( ', () => { > {(query) => <>{query.data.pages.filter(({ text }) => text)}} - ) - ;() => ( + ))() + ;(() => ( ', () => { > {(query) => <>{query.data.pages.filter(({ text }) => text)}} - ) - ;() => ( + ))() + ;(() => ( ', () => { > {(query) => <>{query.data.pages.filter(({ text }) => text)}} - ) - ;() => ( + ))() + ;(() => ( ', () => { > {(query) => <>{query.data.pages.filter(({ text }) => text)}} - ) - ;() => ( + ))() + ;(() => ( {(query) => { expectTypeOf(query).toEqualTypeOf>() @@ -67,8 +67,8 @@ describe('', () => { return <> }} - ) - ;() => ( + ))() + ;(() => ( ', () => { return <> }} - ) + ))() const options = infiniteQueryOptions({ queryKey, queryFn }) - ;() => ( + ;(() => ( {(query) => { expectTypeOf(query).toEqualTypeOf>() @@ -97,8 +97,8 @@ describe('', () => { return <> }} - ) - ;() => ( + ))() + ;(() => ( ({ @@ -113,19 +113,21 @@ describe('', () => { return <> }} - ) + ))() expectTypeOf( {() => <>} - ).toEqualTypeOf() + ).toEqualTypeOf() expectTypeOf( {() => <>} ).not.toEqualTypeOf() - expectTypeOf({() => <>}).toEqualTypeOf() + expectTypeOf( + {() => <>} + ).toEqualTypeOf() expectTypeOf( {() => <>} ).not.toEqualTypeOf() diff --git a/packages/react-query-4/src/SuspenseQueries.test-d.tsx b/packages/react-query-4/src/SuspenseQueries.test-d.tsx index 31fca0823..9ddce05d7 100644 --- a/packages/react-query-4/src/SuspenseQueries.test-d.tsx +++ b/packages/react-query-4/src/SuspenseQueries.test-d.tsx @@ -7,7 +7,7 @@ import type { UseSuspenseQueryResult } from './useSuspenseQuery' describe('', () => { it('type check', () => { - ;() => ( + ;(() => ( {([ query1, @@ -22,8 +22,8 @@ describe('', () => { return <> }} - ) - ;() => ( + ))() + ;(() => ( {([ query1, @@ -38,11 +38,11 @@ describe('', () => { return <> }} - ) + ))() expectTypeOf( {() => <>} - ).toEqualTypeOf() + ).toEqualTypeOf() expectTypeOf( {() => <>} ).not.toEqualTypeOf() diff --git a/packages/react-query-4/src/SuspenseQuery.test-d.tsx b/packages/react-query-4/src/SuspenseQuery.test-d.tsx index e90ad01ce..f19930624 100644 --- a/packages/react-query-4/src/SuspenseQuery.test-d.tsx +++ b/packages/react-query-4/src/SuspenseQuery.test-d.tsx @@ -7,7 +7,7 @@ import type { UseSuspenseQueryResult } from './useSuspenseQuery' describe('', () => { it('type check', () => { - ;() => ( + ;(() => ( ', () => { > {(query) => <>{query.data.text}} - ) - ;() => ( + ))() + ;(() => ( ', () => { > {(query) => <>{query.data.text}} - ) - ;() => ( + ))() + ;(() => ( ', () => { > {(query) => <>{query.data.text}} - ) - ;() => ( + ))() + ;(() => ( ', () => { > {(query) => <>{query.data.text}} - ) - ;() => ( + ))() + ;(() => ( ', () => { > {(query) => <>{query.data.text}} - ) - ;() => ( + ))() + ;(() => ( {(query) => { expectTypeOf(query).toEqualTypeOf>() @@ -66,8 +66,8 @@ describe('', () => { return <> }} - ) - ;() => ( + ))() + ;(() => ( data.text}> {(selectedQuery) => { expectTypeOf(selectedQuery).toEqualTypeOf>() @@ -76,14 +76,14 @@ describe('', () => { return <> }} - ) + ))() const options = queryOptions({ queryKey, queryFn, }) - ;() => ( + ;(() => ( {(query) => { expectTypeOf(query).toEqualTypeOf>() @@ -92,8 +92,8 @@ describe('', () => { return <> }} - ) - ;() => ( + ))() + ;(() => ( data.text}> {(selectedQuery) => { expectTypeOf(selectedQuery).toEqualTypeOf>() @@ -102,19 +102,19 @@ describe('', () => { return <> }} - ) + ))() expectTypeOf( {() => <>} - ).toEqualTypeOf() + ).toEqualTypeOf() expectTypeOf( {() => <>} ).not.toEqualTypeOf() - expectTypeOf({() => <>}).toEqualTypeOf() + expectTypeOf({() => <>}).toEqualTypeOf() expectTypeOf({() => <>}).not.toEqualTypeOf() }) }) diff --git a/packages/react-query-4/src/useSuspenseInfiniteQuery.test-d.ts b/packages/react-query-4/src/useSuspenseInfiniteQuery.test-d.ts index b30d46d88..094671edd 100644 --- a/packages/react-query-4/src/useSuspenseInfiniteQuery.test-d.ts +++ b/packages/react-query-4/src/useSuspenseInfiniteQuery.test-d.ts @@ -32,6 +32,7 @@ describe('useSuspenseInfiniteQuery', () => { // @ts-expect-error no placeholderData placeholderData: 'placeholder', }) + // eslint-disable-next-line @typescript-eslint/no-unused-expressions useSuspenseInfiniteQuery({ queryKey, queryFn, diff --git a/packages/react-query-4/src/useSuspenseQuery.test-d.ts b/packages/react-query-4/src/useSuspenseQuery.test-d.ts index f0fbd7c8f..4647933cc 100644 --- a/packages/react-query-4/src/useSuspenseQuery.test-d.ts +++ b/packages/react-query-4/src/useSuspenseQuery.test-d.ts @@ -31,6 +31,7 @@ describe('useSuspenseQuery', () => { //@ts-expect-error no placeholderData placeholderData: 'placeholder', }) + // eslint-disable-next-line @typescript-eslint/no-unused-expressions useSuspenseQuery({ queryKey, queryFn, diff --git a/packages/react-query-4/src/utility-types/OmitKeyof.test-d.ts b/packages/react-query-4/src/utility-types/OmitKeyof.test-d.ts index a3a78a3ae..1391673bb 100644 --- a/packages/react-query-4/src/utility-types/OmitKeyof.test-d.ts +++ b/packages/react-query-4/src/utility-types/OmitKeyof.test-d.ts @@ -116,6 +116,7 @@ describe('OmitKeyof', () => { it("'s symbol key type check", () => { const symbol1 = Symbol() const symbol2 = Symbol() + // eslint-disable-next-line @typescript-eslint/no-unused-vars const symbol3 = Symbol() type A = { diff --git a/packages/react-query-5/src/Mutation.test-d.tsx b/packages/react-query-5/src/Mutation.test-d.tsx index 8b2413dcd..c64e01799 100644 --- a/packages/react-query-5/src/Mutation.test-d.tsx +++ b/packages/react-query-5/src/Mutation.test-d.tsx @@ -7,16 +7,16 @@ const mutationFn = () => Promise.resolve(5) describe('', () => { it('type check', () => { - ;() => ( + ;(() => ( {(mutation) => { expectTypeOf(mutation).toEqualTypeOf>() return <> }} - ) + ))() - expectTypeOf({() => <>}).toEqualTypeOf() + expectTypeOf({() => <>}).toEqualTypeOf() expectTypeOf({() => <>}).not.toEqualTypeOf() }) }) diff --git a/packages/react-query-5/src/PrefetchInfiniteQuery.test-d.tsx b/packages/react-query-5/src/PrefetchInfiniteQuery.test-d.tsx index 179c62a0b..8d731b16e 100644 --- a/packages/react-query-5/src/PrefetchInfiniteQuery.test-d.tsx +++ b/packages/react-query-5/src/PrefetchInfiniteQuery.test-d.tsx @@ -6,61 +6,63 @@ import { queryFn, queryKey } from './test-utils' describe('', () => { it('type check', () => { - ;() => ( + ;(() => ( - ) - ;() => ( + ))() + ;(() => ( - ) - ;() => ( + ))() + ;(() => ( - ) - ;() => ( + ))() + ;(() => ( - ) - ;() => ( + ))() + ;(() => ( - ) - ;() => + ))() + ;(() => )() const options = infiniteQueryOptions({ queryKey, queryFn, initialPageParam: 'initialPageParam', getNextPageParam: () => null, }) - ;() => + ;(() => )() expectTypeOf( - ).toEqualTypeOf() + ).toEqualTypeOf() expectTypeOf( ).not.toEqualTypeOf() - expectTypeOf({() => <>}).toEqualTypeOf() + expectTypeOf( + {() => <>} + ).toEqualTypeOf() expectTypeOf( {() => <>} ).not.toEqualTypeOf() diff --git a/packages/react-query-5/src/PrefetchQuery.test-d.tsx b/packages/react-query-5/src/PrefetchQuery.test-d.tsx index 62f4b6d99..1d70ffca6 100644 --- a/packages/react-query-5/src/PrefetchQuery.test-d.tsx +++ b/packages/react-query-5/src/PrefetchQuery.test-d.tsx @@ -1,60 +1,60 @@ +import { queryOptions } from '@tanstack/react-query' import type { ReactNode } from 'react' import { describe, expectTypeOf, it } from 'vitest' import { PrefetchQuery } from './PrefetchQuery' -import { queryOptions } from './queryOptions' import { queryFn, queryKey } from './test-utils' describe('', () => { it('type check', () => { - ;() => ( + ;(() => ( - ) - ;() => ( + ))() + ;(() => ( - ) - ;() => ( + ))() + ;(() => ( - ) - ;() => ( + ))() + ;(() => ( - ) - ;() => ( + ))() + ;(() => ( - ) - ;() => + ))() + ;(() => )() const options = queryOptions({ queryKey, queryFn, }) - ;() => - expectTypeOf().toEqualTypeOf() + ;(() => )() + expectTypeOf().toEqualTypeOf() expectTypeOf().not.toEqualTypeOf() - expectTypeOf({() => <>}).toEqualTypeOf() + expectTypeOf({() => <>}).toEqualTypeOf() expectTypeOf({() => <>}).not.toEqualTypeOf() }) }) diff --git a/packages/react-query-5/src/QueryClientConsumer.test-d.tsx b/packages/react-query-5/src/QueryClientConsumer.test-d.tsx index 00c590293..1df41d16e 100644 --- a/packages/react-query-5/src/QueryClientConsumer.test-d.tsx +++ b/packages/react-query-5/src/QueryClientConsumer.test-d.tsx @@ -6,27 +6,27 @@ const queryClient = new QueryClient() describe('', () => { it('type check', () => { - ;() => ( + ;(() => ( {(queryClient) => { expectTypeOf(queryClient).toEqualTypeOf() return <> }} - ) - ;() => ( + ))() + ;(() => ( {(queryClient) => { expectTypeOf(queryClient).toEqualTypeOf() return <> }} - ) - expectTypeOf({() => <>}).toEqualTypeOf() + ))() + expectTypeOf({() => <>}).toEqualTypeOf() expectTypeOf({() => <>}).not.toEqualTypeOf() expectTypeOf( {() => <>} - ).toEqualTypeOf() + ).toEqualTypeOf() expectTypeOf( {() => <>} ).not.toEqualTypeOf() diff --git a/packages/react-query-5/src/SuspenseInfiniteQuery.test-d.tsx b/packages/react-query-5/src/SuspenseInfiniteQuery.test-d.tsx index 580fe3299..c22f93da1 100644 --- a/packages/react-query-5/src/SuspenseInfiniteQuery.test-d.tsx +++ b/packages/react-query-5/src/SuspenseInfiniteQuery.test-d.tsx @@ -6,7 +6,7 @@ import { queryFn, queryKey } from './test-utils' describe('', () => { it('type check', () => { - ;() => ( + ;(() => ( ', () => { > {(query) => <>{query.data.pages.filter(({ text }) => text)}} - ) - ;() => ( + ))() + ;(() => ( ', () => { > {(query) => <>{query.data.pages.filter(({ text }) => text)}} - ) - ;() => ( + ))() + ;(() => ( ', () => { > {(query) => <>{query.data.pages.filter(({ text }) => text)}} - ) - ;() => ( + ))() + ;(() => ( ', () => { > {(query) => <>{query.data.pages.filter(({ text }) => text)}} - ) - ;() => ( + ))() + ;(() => ( ', () => { > {(query) => <>{query.data.pages.filter(({ text }) => text)}} - ) - ;() => ( + ))() + ;(() => ( ', () => { return <> }} - ) - ;() => ( + ))() + ;(() => ( ', () => { return <> }} - ) + ))() expectTypeOf( ', () => { > {() => <>} - ).toEqualTypeOf() + ).toEqualTypeOf() expectTypeOf( ', () => { it('type check', () => { - ;() => ( + ;(() => ( {([ query1, @@ -21,8 +21,8 @@ describe('', () => { return <> }} - ) - ;() => ( + ))() + ;(() => ( ', () => { return <> }} - ) - ;() => ( + ))() + ;(() => ( ', () => { return <> }} - ) + ))() expectTypeOf( {() => <>} - ).toEqualTypeOf() + ).toEqualTypeOf() expectTypeOf( {() => <>} ).not.toEqualTypeOf() diff --git a/packages/react-query-5/src/SuspenseQuery.test-d.tsx b/packages/react-query-5/src/SuspenseQuery.test-d.tsx index a0edfd372..1fca85a3e 100644 --- a/packages/react-query-5/src/SuspenseQuery.test-d.tsx +++ b/packages/react-query-5/src/SuspenseQuery.test-d.tsx @@ -6,7 +6,7 @@ import { queryFn, queryKey } from './test-utils' describe('', () => { it('type check', () => { - ;() => ( + ;(() => ( ', () => { > {(query) => <>{query.data.text}} - ) - ;() => ( + ))() + ;(() => ( ', () => { > {(query) => <>{query.data.text}} - ) - ;() => ( + ))() + ;(() => ( ', () => { > {(query) => <>{query.data.text}} - ) - ;() => ( + ))() + ;(() => ( ', () => { > {(query) => <>{query.data.text}} - ) - ;() => ( + ))() + ;(() => ( ', () => { > {(query) => <>{query.data.text}} - ) - ;() => ( + ))() + ;(() => ( {(query) => { expectTypeOf(query).toEqualTypeOf>() @@ -65,8 +65,8 @@ describe('', () => { return <> }} - ) - ;() => ( + ))() + ;(() => ( data.text}> {(selectedQuery) => { expectTypeOf(selectedQuery).toEqualTypeOf>() @@ -75,13 +75,13 @@ describe('', () => { return <> }} - ) + ))() expectTypeOf( {() => <>} - ).toEqualTypeOf() + ).toEqualTypeOf() expectTypeOf( {() => <>} diff --git a/packages/react-query/src/scripts/utils/copy.ts b/packages/react-query/src/scripts/utils/copy.ts index ad563ffd5..b1e68bb43 100644 --- a/packages/react-query/src/scripts/utils/copy.ts +++ b/packages/react-query/src/scripts/utils/copy.ts @@ -18,7 +18,7 @@ export function copy(version: number) { try { fs.unlinkSync(dest) - } catch (e) { + } catch { /* empty */ } fs.writeFileSync(dest, content, 'utf-8') diff --git a/packages/react-query/src/scripts/utils/package.ts b/packages/react-query/src/scripts/utils/package.ts index 3cc939213..4c3a06143 100644 --- a/packages/react-query/src/scripts/utils/package.ts +++ b/packages/react-query/src/scripts/utils/package.ts @@ -6,9 +6,9 @@ type LoadModuleResult = { exports: T; isSuccess: true } | { exports: undefine export function loadModule(name: string): LoadModuleResult { try { - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports return { exports: require(name) as T, isSuccess: true } - } catch (e) { + } catch { return { exports: undefined, isSuccess: false } } } diff --git a/packages/react-query/src/scripts/utils/switchVersion.spec.ts b/packages/react-query/src/scripts/utils/switchVersion.spec.ts index 0870d0ee6..22e438552 100644 --- a/packages/react-query/src/scripts/utils/switchVersion.spec.ts +++ b/packages/react-query/src/scripts/utils/switchVersion.spec.ts @@ -1,5 +1,6 @@ import type { MockInstance } from 'vitest' import { copy } from './copy' +import { noop } from './noop' import { switchVersion } from './switchVersion' vi.mock('./copy', () => ({ @@ -11,8 +12,8 @@ describe('switchVersion', () => { let consoleWarnSpy: MockInstance beforeEach(() => { - consoleLogSpy = vi.spyOn(console, 'log').mockImplementation(() => {}) - consoleWarnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {}) + consoleLogSpy = vi.spyOn(console, 'log').mockImplementation(noop) + consoleWarnSpy = vi.spyOn(console, 'warn').mockImplementation(noop) }) afterEach(() => { diff --git a/packages/react/src/Delay.test-d.tsx b/packages/react/src/Delay.test-d.tsx index ca1c4c70a..1f367bbf4 100644 --- a/packages/react/src/Delay.test-d.tsx +++ b/packages/react/src/Delay.test-d.tsx @@ -7,7 +7,7 @@ describe('', () => { <> - ).toEqualTypeOf() + ).toEqualTypeOf() expectTypeOf( <> @@ -20,7 +20,7 @@ describe('', () => { return <> }} - ).toEqualTypeOf() + ).toEqualTypeOf() expectTypeOf( {({ isDelayed }) => { @@ -37,6 +37,6 @@ describe('', () => { return <> }} - ).toEqualTypeOf() + ).toEqualTypeOf() }) }) diff --git a/packages/react/src/DevMode.spec.tsx b/packages/react/src/DevMode.spec.tsx index 2b5f84295..b234d52ea 100644 --- a/packages/react/src/DevMode.spec.tsx +++ b/packages/react/src/DevMode.spec.tsx @@ -4,8 +4,9 @@ import { Suspense } from './Suspense' describe('', () => { it('should return just null this should be removed at @suspensive/react v3', () => { + // eslint-disable-next-line @typescript-eslint/no-deprecated expect(DevMode({})).toBe(null) }) - ;() => // devMode prop jsdoc deprecated - ;() => null} devMode={{}} /> // devMode prop jsdoc deprecated + ;(() => )() // devMode prop jsdoc deprecated + ;(() => null} devMode={{}} />)() // devMode prop jsdoc deprecated }) diff --git a/packages/react/src/ErrorBoundary.test-d.tsx b/packages/react/src/ErrorBoundary.test-d.tsx index a5d42ef3b..0ea035f5c 100644 --- a/packages/react/src/ErrorBoundary.test-d.tsx +++ b/packages/react/src/ErrorBoundary.test-d.tsx @@ -42,7 +42,7 @@ describe('', () => { }) it('type check', () => { - expectTypeOf({() => <>}).toEqualTypeOf() + expectTypeOf({() => <>}).toEqualTypeOf() expectTypeOf({() => <>}).not.toEqualTypeOf() }) }) diff --git a/packages/react/src/ErrorBoundary.tsx b/packages/react/src/ErrorBoundary.tsx index 76aa0a6c3..cea9ea5e9 100644 --- a/packages/react/src/ErrorBoundary.tsx +++ b/packages/react/src/ErrorBoundary.tsx @@ -224,13 +224,13 @@ if (process.env.NODE_ENV === 'development') { ErrorBoundaryContext.displayName = 'ErrorBoundaryContext' } +// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters export const useErrorBoundary = () => { const [state, setState] = useState>({ isError: false, error: null, }) if (state.isError) { - // eslint-disable-next-line @typescript-eslint/only-throw-error throw state.error } diff --git a/packages/react/src/ErrorBoundaryGroup.test-d.tsx b/packages/react/src/ErrorBoundaryGroup.test-d.tsx index 25f77ef72..91ce4f867 100644 --- a/packages/react/src/ErrorBoundaryGroup.test-d.tsx +++ b/packages/react/src/ErrorBoundaryGroup.test-d.tsx @@ -3,7 +3,9 @@ import { ErrorBoundaryGroup } from './ErrorBoundaryGroup' describe('ErrorBoundaryGroup', () => { it('type check', () => { - expectTypeOf({() => <>}).toEqualTypeOf() + expectTypeOf( + {() => <>} + ).toEqualTypeOf() expectTypeOf( {() => <>} ).not.toEqualTypeOf() diff --git a/packages/react/src/Suspensive.spec.tsx b/packages/react/src/Suspensive.spec.tsx index f328d2658..a704e1a3e 100644 --- a/packages/react/src/Suspensive.spec.tsx +++ b/packages/react/src/Suspensive.spec.tsx @@ -13,6 +13,7 @@ const FALLBACK_GLOBAL = 'FALLBACK_GLOBAL' describe('', () => { it('should provide default ms prop of Delay', async () => { render( + // eslint-disable-next-line @typescript-eslint/no-deprecated {TEXT} @@ -22,6 +23,7 @@ describe('', () => { }) it('should accept suspensive value with nothing about Delay', () => { render( + // eslint-disable-next-line @typescript-eslint/no-deprecated {TEXT} @@ -30,6 +32,7 @@ describe('', () => { }) it('should accept empty suspensive value', () => { render( + // eslint-disable-next-line @typescript-eslint/no-deprecated {TEXT} @@ -38,6 +41,7 @@ describe('', () => { }) it('should accept no suspensive value', () => { render( + // eslint-disable-next-line @typescript-eslint/no-deprecated {TEXT} @@ -47,6 +51,7 @@ describe('', () => { it('should accept defaultProps.suspense.fallback to setup default fallback of Suspense. If Suspense accepted no fallback, Suspense should use default fallback', () => { render( + // eslint-disable-next-line @typescript-eslint/no-deprecated @@ -57,6 +62,7 @@ describe('', () => { }) it('should accept defaultProps.suspense.fallback to setup default fallback of Suspense. If Suspense accepted local fallback, Suspense should ignore default fallback and show it', () => { render( + // eslint-disable-next-line @typescript-eslint/no-deprecated @@ -68,6 +74,7 @@ describe('', () => { }) it('should accept defaultProps.suspense.fallback to setup default fallback of Suspense. If Suspense accepted local fallback as null, Suspense should ignore default fallback. even though local fallback is nullish', () => { render( + // eslint-disable-next-line @typescript-eslint/no-deprecated @@ -80,6 +87,7 @@ describe('', () => { it('should accept defaultProps.suspense.clientOnly to setup default clientOnly prop of Suspense. If Suspense accept no clientOnly, Suspense should use default fallback', () => { let clientOnly1: SuspenseProps['clientOnly'] = undefined render( + // eslint-disable-next-line @typescript-eslint/no-deprecated {createElement(() => { clientOnly1 = useContext(SuspenseDefaultPropsContext).clientOnly @@ -91,6 +99,7 @@ describe('', () => { let clientOnly2: SuspenseProps['clientOnly'] = undefined render( + // eslint-disable-next-line @typescript-eslint/no-deprecated {createElement(() => { clientOnly2 = useContext(SuspenseDefaultPropsContext).clientOnly @@ -102,6 +111,7 @@ describe('', () => { const clientOnly3: SuspenseProps['clientOnly'] = undefined render( + // eslint-disable-next-line @typescript-eslint/no-deprecated {createElement(() => { clientOnly2 = useContext(SuspenseDefaultPropsContext).clientOnly @@ -113,10 +123,12 @@ describe('', () => { }) it('should accept defaultOptions.delay.ms only positive number', () => { + // eslint-disable-next-line @typescript-eslint/no-deprecated expect(() => new Suspensive({ defaultProps: { delay: { ms: 0 } } })).toThrow( Message_DefaultProp_delay_ms_should_be_greater_than_0 ) try { + // eslint-disable-next-line @typescript-eslint/no-deprecated new Suspensive({ defaultProps: { delay: { ms: 0 } } }) } catch (error) { expect(error).toBeInstanceOf(SuspensiveError) @@ -124,10 +136,12 @@ describe('', () => { expect(error).not.toBeInstanceOf(CustomError) } + // eslint-disable-next-line @typescript-eslint/no-deprecated expect(() => new Suspensive({ defaultProps: { delay: { ms: -1 } } })).toThrow( Message_DefaultProp_delay_ms_should_be_greater_than_0 ) try { + // eslint-disable-next-line @typescript-eslint/no-deprecated new Suspensive({ defaultProps: { delay: { ms: -1 } } }) } catch (error) { expect(error).toBeInstanceOf(SuspensiveError) @@ -138,6 +152,7 @@ describe('', () => { const defaultPropsMs = 100 let ms: DelayProps['ms'] = undefined render( + // eslint-disable-next-line @typescript-eslint/no-deprecated {createElement(() => { ms = useContext(DelayDefaultPropsContext).ms diff --git a/packages/react/src/Suspensive.tsx b/packages/react/src/Suspensive.tsx index 80cd0014d..7143efbfd 100644 --- a/packages/react/src/Suspensive.tsx +++ b/packages/react/src/Suspensive.tsx @@ -27,9 +27,12 @@ export class Suspensive { defaultProps?: LowercaseFirstDepthFieldOf } = {} ) { + // eslint-disable-next-line @typescript-eslint/no-deprecated if (process.env.NODE_ENV === 'development' && typeof config.defaultProps?.delay?.ms === 'number') { + // eslint-disable-next-line @typescript-eslint/no-deprecated SuspensiveError.assert(config.defaultProps.delay.ms > 0, Message_DefaultProp_delay_ms_should_be_greater_than_0) } + // eslint-disable-next-line @typescript-eslint/no-deprecated this.defaultProps = config.defaultProps } } @@ -41,12 +44,14 @@ interface SuspensiveProviderProps extends PropsWithChildren { /** * @deprecated Use DefaultPropsProvider instead */ + // eslint-disable-next-line @typescript-eslint/no-deprecated value: Suspensive } /** * @deprecated Use DefaultPropsProvider instead */ +// eslint-disable-next-line @typescript-eslint/no-deprecated export const SuspensiveProvider = ({ value, children }: SuspensiveProviderProps) => { const defaultProps = useMemo( () => new DefaultProps({ Delay: value.defaultProps?.delay, Suspense: value.defaultProps?.suspense }), diff --git a/packages/react/src/hooks/useIsClient.spec.ts b/packages/react/src/hooks/useIsClient.spec.ts index c335cc971..3389613a6 100644 --- a/packages/react/src/hooks/useIsClient.spec.ts +++ b/packages/react/src/hooks/useIsClient.spec.ts @@ -38,11 +38,15 @@ describe('useIsClient', () => { }, []) return isClient }) + // eslint-disable-next-line @typescript-eslint/no-deprecated const { unmount } = renderHook(() => mockUseIsClientLegacy()) + // eslint-disable-next-line @typescript-eslint/no-deprecated expect(mockUseIsClientLegacy).toBeCalledTimes(2) expect(chanceIsClientToBeFalse).toBe(true) unmount() + // eslint-disable-next-line @typescript-eslint/no-deprecated renderHook(() => mockUseIsClientLegacy()) + // eslint-disable-next-line @typescript-eslint/no-deprecated expect(mockUseIsClientLegacy).toBeCalledTimes(4) expect(chanceIsClientToBeFalse).toBe(true) }) diff --git a/packages/react/src/hooks/usePreservedCallback.test-d.ts b/packages/react/src/hooks/usePreservedCallback.test-d.ts index 260deacc0..e9c9a55fa 100644 --- a/packages/react/src/hooks/usePreservedCallback.test-d.ts +++ b/packages/react/src/hooks/usePreservedCallback.test-d.ts @@ -8,20 +8,13 @@ describe('usePreservedCallback', () => { }) ).toEqualTypeOf<() => void>() - expectTypeOf( - usePreservedCallback((a: number, b: string) => { - a - b - }) - ).toEqualTypeOf<(a: number, b: string) => void>() + // eslint-disable-next-line @typescript-eslint/no-unused-vars + expectTypeOf(usePreservedCallback((a: number, b: string) => {})).toEqualTypeOf<(a: number, b: string) => void>() expectTypeOf(usePreservedCallback((a: number, b: string) => (Math.random() > 0.5 ? a : b))).toEqualTypeOf< (a: number, b: string) => number | string >() - expectTypeOf( - usePreservedCallback((a) => { - a - }) - ).toEqualTypeOf<(a: any) => void>() + // eslint-disable-next-line @typescript-eslint/no-unused-vars + expectTypeOf(usePreservedCallback((a) => {})).toEqualTypeOf<(a: any) => void>() }) }) diff --git a/packages/react/src/utility-types/OmitKeyof.test-d.ts b/packages/react/src/utility-types/OmitKeyof.test-d.ts index a3a78a3ae..1391673bb 100644 --- a/packages/react/src/utility-types/OmitKeyof.test-d.ts +++ b/packages/react/src/utility-types/OmitKeyof.test-d.ts @@ -116,6 +116,7 @@ describe('OmitKeyof', () => { it("'s symbol key type check", () => { const symbol1 = Symbol() const symbol2 = Symbol() + // eslint-disable-next-line @typescript-eslint/no-unused-vars const symbol3 = Symbol() type A = { diff --git a/packages/react/src/utils/defineSuspense.tsx b/packages/react/src/utils/defineSuspense.tsx index 8fc308c04..c1a42a7bc 100644 --- a/packages/react/src/utils/defineSuspense.tsx +++ b/packages/react/src/utils/defineSuspense.tsx @@ -34,7 +34,7 @@ export function defineSuspense(options: { componentPropsClientOnly: false defaultPropsClientOnly: false }): typeof Suspense -// eslint-disable-next-line @typescript-eslint/ban-types +// eslint-disable-next-line @typescript-eslint/no-empty-object-type export function defineSuspense(options: {}): typeof Suspense export function defineSuspense({ defaultPropsClientOnly, From d4cb7b8dcce0eed601c9a557222665b2f7e8efa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=84=9D=EC=A7=84?= Date: Sat, 19 Oct 2024 14:28:56 +0900 Subject: [PATCH 3/9] fix(*): knip error --- knip.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/knip.json b/knip.json index 5c4865c70..12a578856 100644 --- a/knip.json +++ b/knip.json @@ -24,6 +24,9 @@ "packages/react-native": { "ignoreDependencies": ["expo", "ts-node"], "ignore": ["babel.config.cjs"] + }, + "packages/react-dom": { + "ignoreDependencies": ["react-dom", "@types/react-dom"] } } } From e1c92ea53a307f50714ec5bef0cd52260e2e75e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=84=9D=EC=A7=84?= Date: Sat, 19 Oct 2024 22:53:46 +0900 Subject: [PATCH 4/9] chore: update Co-authored-by: Sol Lee <82362278+saul-atomrigs@users.noreply.github.com> Co-authored-by: Varad Gupta <114755221+vr-varad@users.noreply.github.com> Co-authored-by: Jonghyeon Ko <61593290+manudeli@users.noreply.github.com> From 25ae817616b65e7958ad8c7c4283a9b684566ed0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=84=9D=EC=A7=84?= Date: Sat, 19 Oct 2024 22:53:46 +0900 Subject: [PATCH 5/9] chore: update Co-authored-by: Sol Lee <82362278+saul-atomrigs@users.noreply.github.com> Co-authored-by: Varad Gupta <114755221+vr-varad@users.noreply.github.com> Co-authored-by: Jonghyeon Ko <61593290+manudeli@users.noreply.github.com> From 3f5ed294e90c2a3e75f76d9b6eb30709e06c9ead Mon Sep 17 00:00:00 2001 From: Jonghyeon Ko Date: Mon, 21 Oct 2024 00:24:38 +0900 Subject: [PATCH 6/9] chore: update --- packages/react-dom/src/test-utils/index.ts | 4 +--- packages/react-query/src/scripts/utils/commands.spec.ts | 7 +++---- packages/react-query/src/scripts/utils/copy.spec.ts | 5 ++--- packages/react-query/src/scripts/utils/noop.ts | 1 - .../react-query/src/scripts/utils/switchVersion.spec.ts | 5 ++--- 5 files changed, 8 insertions(+), 14 deletions(-) delete mode 100644 packages/react-query/src/scripts/utils/noop.ts diff --git a/packages/react-dom/src/test-utils/index.ts b/packages/react-dom/src/test-utils/index.ts index a09ab902e..184531b06 100644 --- a/packages/react-dom/src/test-utils/index.ts +++ b/packages/react-dom/src/test-utils/index.ts @@ -1,4 +1,4 @@ -import * as React from 'react' +import { act } from 'react' declare global { // eslint-disable-next-line no-var @@ -7,8 +7,6 @@ declare global { var jest: { fn: typeof vi.fn } | undefined } -const act = React.act - type Item = { callback: IntersectionObserverCallback elements: Set diff --git a/packages/react-query/src/scripts/utils/commands.spec.ts b/packages/react-query/src/scripts/utils/commands.spec.ts index ce7c5eeaa..d6cc0ed38 100644 --- a/packages/react-query/src/scripts/utils/commands.spec.ts +++ b/packages/react-query/src/scripts/utils/commands.spec.ts @@ -2,7 +2,6 @@ import fs from 'fs' import type { Mock, MockInstance } from 'vitest' import packageJson from '../../../package.json' import { fixAction, statusAction, switchAction } from './commands' -import { noop } from './noop' import { getIndexFileContent, getPackageJson, @@ -25,8 +24,8 @@ describe('commands', () => { let consoleWarnSpy: MockInstance beforeEach(() => { - consoleLogSpy = vi.spyOn(console, 'log').mockImplementation(noop) - consoleWarnSpy = vi.spyOn(console, 'warn').mockImplementation(noop) + consoleLogSpy = vi.spyOn(console, 'log').mockImplementation(() => {}) + consoleWarnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {}) const getPackageJsonMock = getPackageJson as Mock getPackageJsonMock.mockReturnValue(packageJson) @@ -43,7 +42,7 @@ describe('commands', () => { const getTanStackReactQueryAPIsMock = getTanStackReactQueryAPIs as Mock getTanStackReactQueryAPIsMock.mockReturnValue([]) - vi.mocked(switchVersion).mockImplementation(noop) + vi.mocked(switchVersion).mockImplementation(() => {}) }) afterEach(() => { diff --git a/packages/react-query/src/scripts/utils/copy.spec.ts b/packages/react-query/src/scripts/utils/copy.spec.ts index 844a5f2e0..5b36c9832 100644 --- a/packages/react-query/src/scripts/utils/copy.spec.ts +++ b/packages/react-query/src/scripts/utils/copy.spec.ts @@ -1,6 +1,5 @@ import fs from 'fs' import { copy } from './copy' -import { noop } from './noop' describe('copy', () => { beforeEach(() => { @@ -19,8 +18,8 @@ describe('copy', () => { it('should copy and replace files with the specified version', () => { vi.spyOn(fs, 'readdirSync').mockReturnValue(['v5', 'other'] as unknown as fs.Dirent[]) - vi.spyOn(fs, 'unlinkSync').mockImplementation(noop) - vi.spyOn(fs, 'writeFileSync').mockImplementation(noop) + vi.spyOn(fs, 'unlinkSync').mockImplementation(() => {}) + vi.spyOn(fs, 'writeFileSync').mockImplementation(() => {}) expect(copy(5)).toBe(true) expect(fs.readdirSync).toHaveBeenCalledTimes(1) diff --git a/packages/react-query/src/scripts/utils/noop.ts b/packages/react-query/src/scripts/utils/noop.ts deleted file mode 100644 index c554e0738..000000000 --- a/packages/react-query/src/scripts/utils/noop.ts +++ /dev/null @@ -1 +0,0 @@ -export const noop = (): void => {} diff --git a/packages/react-query/src/scripts/utils/switchVersion.spec.ts b/packages/react-query/src/scripts/utils/switchVersion.spec.ts index 22e438552..0870d0ee6 100644 --- a/packages/react-query/src/scripts/utils/switchVersion.spec.ts +++ b/packages/react-query/src/scripts/utils/switchVersion.spec.ts @@ -1,6 +1,5 @@ import type { MockInstance } from 'vitest' import { copy } from './copy' -import { noop } from './noop' import { switchVersion } from './switchVersion' vi.mock('./copy', () => ({ @@ -12,8 +11,8 @@ describe('switchVersion', () => { let consoleWarnSpy: MockInstance beforeEach(() => { - consoleLogSpy = vi.spyOn(console, 'log').mockImplementation(noop) - consoleWarnSpy = vi.spyOn(console, 'warn').mockImplementation(noop) + consoleLogSpy = vi.spyOn(console, 'log').mockImplementation(() => {}) + consoleWarnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {}) }) afterEach(() => { From 84088673b707a0a769e06f38042e1ef8bfdc0f1a Mon Sep 17 00:00:00 2001 From: Jonghyeon Ko Date: Mon, 21 Oct 2024 00:43:24 +0900 Subject: [PATCH 7/9] chore: remove js, jsx, mjs, cjs check --- configs/eslint-config/package.json | 2 +- configs/tsconfig/base.json | 3 +-- configs/tsconfig/nextjs.json | 1 - configs/tsup/package.json | 2 +- docs/suspensive.org/package.json | 2 +- packages/jotai/package.json | 2 +- packages/jotai/tsconfig.json | 2 +- packages/react-dom/package.json | 2 +- packages/react-dom/tsconfig.json | 2 +- packages/react-native/package.json | 2 +- packages/react-native/tsconfig.json | 2 +- packages/react-query-4/package.json | 2 +- packages/react-query-4/tsconfig.json | 2 +- packages/react-query-5/package.json | 2 +- packages/react-query-5/tsconfig.json | 2 +- packages/react-query/package.json | 2 +- packages/react-query/tsconfig.json | 2 +- packages/react/package.json | 2 +- packages/react/tsconfig.json | 2 +- 19 files changed, 18 insertions(+), 20 deletions(-) diff --git a/configs/eslint-config/package.json b/configs/eslint-config/package.json index d3f19958f..fc76f5327 100644 --- a/configs/eslint-config/package.json +++ b/configs/eslint-config/package.json @@ -24,7 +24,7 @@ "scripts": { "build": "tsup", "ci:attw": "attw --pack", - "ci:eslint": "eslint \"**/*.{js,jsx,cjs,mjs,ts,tsx,cts,mts}\"", + "ci:eslint": "eslint \"**/*.{ts,tsx,cts,mts}\"", "ci:publint": "publint --strict", "ci:type": "tsc --noEmit", "clean": "rimraf ./dist && rimraf ./coverage", diff --git a/configs/tsconfig/base.json b/configs/tsconfig/base.json index ba333c374..5fde1699c 100644 --- a/configs/tsconfig/base.json +++ b/configs/tsconfig/base.json @@ -15,8 +15,7 @@ "preserveWatchOutput": true, "skipLibCheck": true, "strict": true, - "resolveJsonModule": true, - "allowJs": true + "resolveJsonModule": true }, "exclude": ["dist", "esm", "build", "node_modules"] } diff --git a/configs/tsconfig/nextjs.json b/configs/tsconfig/nextjs.json index 3b7dfa900..06753c821 100644 --- a/configs/tsconfig/nextjs.json +++ b/configs/tsconfig/nextjs.json @@ -5,7 +5,6 @@ "compilerOptions": { "target": "es5", "lib": ["dom", "dom.iterable", "esnext"], - "allowJs": true, "skipLibCheck": true, "strict": true, "forceConsistentCasingInFileNames": true, diff --git a/configs/tsup/package.json b/configs/tsup/package.json index 4021f078c..25deae92f 100644 --- a/configs/tsup/package.json +++ b/configs/tsup/package.json @@ -24,7 +24,7 @@ "scripts": { "build": "tsup", "ci:attw": "attw --pack", - "ci:eslint": "eslint \"**/*.{js,jsx,cjs,mjs,ts,tsx,cts,mts}\"", + "ci:eslint": "eslint \"**/*.{ts,tsx,cts,mts}\"", "ci:publint": "publint --strict", "ci:type": "tsc --noEmit", "clean": "rimraf ./dist && rimraf ./coverage", diff --git a/docs/suspensive.org/package.json b/docs/suspensive.org/package.json index 2dea958f2..0fdad128c 100644 --- a/docs/suspensive.org/package.json +++ b/docs/suspensive.org/package.json @@ -15,7 +15,7 @@ "type": "commonjs", "scripts": { "build": "next build", - "ci:eslint": "eslint \"**/*.{js,jsx,cjs,mjs,ts,tsx,cts,mts,mdx}\"", + "ci:eslint": "eslint \"**/*.{ts,tsx,cts,mts,mdx}\"", "ci:type": "tsc --noEmit", "clean": "rimraf ./.next", "dev": "next dev -p 4000", diff --git a/packages/jotai/package.json b/packages/jotai/package.json index 9e7c4e904..92bdb7551 100644 --- a/packages/jotai/package.json +++ b/packages/jotai/package.json @@ -41,7 +41,7 @@ "scripts": { "build": "tsup", "ci:attw": "attw --pack", - "ci:eslint": "eslint \"**/*.{js,jsx,cjs,mjs,ts,tsx,cts,mts}\"", + "ci:eslint": "eslint \"**/*.{ts,tsx,cts,mts}\"", "ci:publint": "publint --strict", "ci:test": "vitest run --coverage --typecheck", "ci:type": "tsc --noEmit", diff --git a/packages/jotai/tsconfig.json b/packages/jotai/tsconfig.json index 2176a2e69..b7f9106c1 100644 --- a/packages/jotai/tsconfig.json +++ b/packages/jotai/tsconfig.json @@ -1,6 +1,6 @@ { "extends": "@suspensive/tsconfig/react-library.json", - "include": [".", "eslint.config.mjs"], + "include": ["."], "compilerOptions": { "types": ["@testing-library/jest-dom/vitest", "vitest/globals"] } diff --git a/packages/react-dom/package.json b/packages/react-dom/package.json index 5006f7973..bdde27de2 100644 --- a/packages/react-dom/package.json +++ b/packages/react-dom/package.json @@ -41,7 +41,7 @@ "scripts": { "build": "tsup", "ci:attw": "attw --pack", - "ci:eslint": "eslint \"**/*.{js,jsx,cjs,mjs,ts,tsx,cts,mts}\"", + "ci:eslint": "eslint \"**/*.{ts,tsx,cts,mts}\"", "ci:publint": "publint --strict", "ci:test": "vitest run --coverage --typecheck", "ci:type": "tsc --noEmit", diff --git a/packages/react-dom/tsconfig.json b/packages/react-dom/tsconfig.json index c1d43485e..8f7937856 100644 --- a/packages/react-dom/tsconfig.json +++ b/packages/react-dom/tsconfig.json @@ -1,6 +1,6 @@ { "extends": "@suspensive/tsconfig/react-library.json", - "include": [".", "eslint.config.mjs"], + "include": ["."], "compilerOptions": { "types": ["@testing-library/jest-dom/vitest", "vitest/globals", "@vitest/browser/providers/playwright"] } diff --git a/packages/react-native/package.json b/packages/react-native/package.json index 797871e50..2a57ffeec 100644 --- a/packages/react-native/package.json +++ b/packages/react-native/package.json @@ -41,7 +41,7 @@ "scripts": { "build": "tsup", "ci:attw": "attw --pack", - "ci:eslint": "eslint \"**/*.{js,jsx,cjs,mjs,ts,tsx,cts,mts}\"", + "ci:eslint": "eslint \"**/*.{ts,tsx,cts,mts}\"", "ci:publint": "publint --strict", "ci:test": "jest --coverage", "ci:type": "tsc --noEmit", diff --git a/packages/react-native/tsconfig.json b/packages/react-native/tsconfig.json index a2ac384be..aa0653f11 100644 --- a/packages/react-native/tsconfig.json +++ b/packages/react-native/tsconfig.json @@ -1,6 +1,6 @@ { "extends": "@suspensive/tsconfig/react-library.json", - "include": [".", "eslint.config.mjs", "./babel.config.cjs"], + "include": ["."], "compilerOptions": { "types": ["vitest/globals"] } diff --git a/packages/react-query-4/package.json b/packages/react-query-4/package.json index aa3611ab3..9d86a880c 100644 --- a/packages/react-query-4/package.json +++ b/packages/react-query-4/package.json @@ -41,7 +41,7 @@ "scripts": { "build": "tsup", "ci:attw": "attw --pack", - "ci:eslint": "eslint \"**/*.{js,jsx,cjs,mjs,ts,tsx,cts,mts}\"", + "ci:eslint": "eslint \"**/*.{ts,tsx,cts,mts}\"", "ci:publint": "publint --strict", "ci:test": "vitest run --coverage --typecheck", "ci:type": "tsc --noEmit", diff --git a/packages/react-query-4/tsconfig.json b/packages/react-query-4/tsconfig.json index 2176a2e69..b7f9106c1 100644 --- a/packages/react-query-4/tsconfig.json +++ b/packages/react-query-4/tsconfig.json @@ -1,6 +1,6 @@ { "extends": "@suspensive/tsconfig/react-library.json", - "include": [".", "eslint.config.mjs"], + "include": ["."], "compilerOptions": { "types": ["@testing-library/jest-dom/vitest", "vitest/globals"] } diff --git a/packages/react-query-5/package.json b/packages/react-query-5/package.json index 2bb3b0174..e7f4114de 100644 --- a/packages/react-query-5/package.json +++ b/packages/react-query-5/package.json @@ -41,7 +41,7 @@ "scripts": { "build": "tsup", "ci:attw": "attw --pack", - "ci:eslint": "eslint \"**/*.{js,jsx,cjs,mjs,ts,tsx,cts,mts}\"", + "ci:eslint": "eslint \"**/*.{ts,tsx,cts,mts}\"", "ci:publint": "publint --strict", "ci:test": "vitest run --coverage --typecheck", "ci:type": "tsc --noEmit", diff --git a/packages/react-query-5/tsconfig.json b/packages/react-query-5/tsconfig.json index 2176a2e69..b7f9106c1 100644 --- a/packages/react-query-5/tsconfig.json +++ b/packages/react-query-5/tsconfig.json @@ -1,6 +1,6 @@ { "extends": "@suspensive/tsconfig/react-library.json", - "include": [".", "eslint.config.mjs"], + "include": ["."], "compilerOptions": { "types": ["@testing-library/jest-dom/vitest", "vitest/globals"] } diff --git a/packages/react-query/package.json b/packages/react-query/package.json index a86cd51cd..89b820ada 100644 --- a/packages/react-query/package.json +++ b/packages/react-query/package.json @@ -45,7 +45,7 @@ "scripts": { "build": "tsup", "ci:attw": "attw --pack", - "ci:eslint": "eslint \"**/*.{js,jsx,cjs,mjs,ts,tsx,cts,mts}\"", + "ci:eslint": "eslint \"**/*.{ts,tsx,cts,mts}\"", "ci:publint": "publint --strict", "ci:test": "vitest run --coverage --typecheck", "ci:type": "tsc --noEmit", diff --git a/packages/react-query/tsconfig.json b/packages/react-query/tsconfig.json index 2176a2e69..b7f9106c1 100644 --- a/packages/react-query/tsconfig.json +++ b/packages/react-query/tsconfig.json @@ -1,6 +1,6 @@ { "extends": "@suspensive/tsconfig/react-library.json", - "include": [".", "eslint.config.mjs"], + "include": ["."], "compilerOptions": { "types": ["@testing-library/jest-dom/vitest", "vitest/globals"] } diff --git a/packages/react/package.json b/packages/react/package.json index 4aac9bb34..63a8adc74 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -41,7 +41,7 @@ "build": "tsup", "ci:attw": "attw --pack", "ci:bench": "vitest bench --run", - "ci:eslint": "eslint \"**/*.{js,jsx,cjs,mjs,ts,tsx,cts,mts}\"", + "ci:eslint": "eslint \"**/*.{ts,tsx,cts,mts}\"", "ci:publint": "publint --strict", "ci:test": "vitest run --coverage --typecheck", "ci:type": "tsc --noEmit", diff --git a/packages/react/tsconfig.json b/packages/react/tsconfig.json index 2176a2e69..b7f9106c1 100644 --- a/packages/react/tsconfig.json +++ b/packages/react/tsconfig.json @@ -1,6 +1,6 @@ { "extends": "@suspensive/tsconfig/react-library.json", - "include": [".", "eslint.config.mjs"], + "include": ["."], "compilerOptions": { "types": ["@testing-library/jest-dom/vitest", "vitest/globals"] } From 420cbeb80f8c490732dde0299766e394c55a94a5 Mon Sep 17 00:00:00 2001 From: Jonghyeon Ko Date: Mon, 21 Oct 2024 00:50:28 +0900 Subject: [PATCH 8/9] chore: update --- .../tsconfig.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/vite-react-18-suspense-prerender-siblings-problem/tsconfig.json b/examples/vite-react-18-suspense-prerender-siblings-problem/tsconfig.json index 4b7ba968d..83f72004d 100644 --- a/examples/vite-react-18-suspense-prerender-siblings-problem/tsconfig.json +++ b/examples/vite-react-18-suspense-prerender-siblings-problem/tsconfig.json @@ -18,8 +18,7 @@ "strict": true, "noUnusedLocals": true, "noUnusedParameters": true, - "noFallthroughCasesInSwitch": true, - "allowJs": true + "noFallthroughCasesInSwitch": true }, "include": ["src", "eslint.config.mjs", "vite.config.ts"] } From db08a1a5740db520d7aeb7e67a64ca2761080c21 Mon Sep 17 00:00:00 2001 From: Jonghyeon Ko Date: Mon, 21 Oct 2024 00:52:30 +0900 Subject: [PATCH 9/9] chore: update --- .../package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/vite-react-18-suspense-prerender-siblings-problem/package.json b/examples/vite-react-18-suspense-prerender-siblings-problem/package.json index 85d981b7d..17f529ec4 100644 --- a/examples/vite-react-18-suspense-prerender-siblings-problem/package.json +++ b/examples/vite-react-18-suspense-prerender-siblings-problem/package.json @@ -6,7 +6,7 @@ "type": "module", "scripts": { "build": "tsc -b && vite build", - "ci:eslint": "eslint .", + "ci:eslint": "eslint \"**/*.{ts,tsx,cts,mts}\"", "dev": "vite", "preview": "vite preview" },