From 97350289fa9999473fc2907328192b5b8f43eeac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90=20Kevin=20Deng?= Date: Sat, 9 Mar 2024 06:28:46 +0800 Subject: [PATCH] refactor: update tsconfig ref: https://www.totaltypescript.com/tsconfig-cheat-sheet --- package.json | 2 +- pnpm-lock.yaml | 94 +++++++++++++++++++++++++------------------------- tsconfig.json | 5 +-- 3 files changed, 51 insertions(+), 50 deletions(-) diff --git a/package.json b/package.json index abf41e0..f2b6bae 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "prettier": "^3.2.5", "tsup": "^8.0.2", "tsx": "^4.7.1", - "typescript": "^5.3.3", + "typescript": "^5.4.2", "vite": "^5.1.4", "vitest": "^1.3.1" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 583393a..d09906e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,7 +18,7 @@ dependencies: devDependencies: '@sxzz/eslint-config': specifier: ^3.8.5 - version: 3.8.5(@typescript-eslint/parser@7.0.2)(eslint@8.57.0)(typescript@5.3.3) + version: 3.8.5(@typescript-eslint/parser@7.0.2)(eslint@8.57.0)(typescript@5.4.2) '@sxzz/prettier-config': specifier: ^2.0.1 version: 2.0.1 @@ -39,13 +39,13 @@ devDependencies: version: 3.2.5 tsup: specifier: ^8.0.2 - version: 8.0.2(typescript@5.3.3) + version: 8.0.2(typescript@5.4.2) tsx: specifier: ^4.7.1 version: 4.7.1 typescript: - specifier: ^5.3.3 - version: 5.3.3 + specifier: ^5.4.2 + version: 5.4.2 vite: specifier: ^5.1.4 version: 5.1.4(@types/node@20.11.24) @@ -551,13 +551,13 @@ packages: resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} dev: true - /@sxzz/eslint-config@3.8.5(@typescript-eslint/parser@7.0.2)(eslint@8.57.0)(typescript@5.3.3): + /@sxzz/eslint-config@3.8.5(@typescript-eslint/parser@7.0.2)(eslint@8.57.0)(typescript@5.4.2): resolution: {integrity: sha512-ke0G3Zu0cpDUWeXCUWcv1xS6/sy6VZO44wgXRxlI6j52KjDZTUMj8NlEHF8iXQt0LxMUrQKzwHtMmbbjKZW03Q==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 || ^9.0.0 dependencies: - '@unocss/eslint-plugin': 0.58.5(eslint@8.57.0)(typescript@5.3.3) + '@unocss/eslint-plugin': 0.58.5(eslint@8.57.0)(typescript@5.4.2) eslint: 8.57.0 eslint-config-prettier: 9.1.0(eslint@8.57.0) eslint-define-config: 1.24.1 @@ -567,7 +567,7 @@ packages: eslint-plugin-jsonc: 2.13.0(eslint@8.57.0) eslint-plugin-markdown: 3.0.1(eslint@8.57.0) eslint-plugin-n: 16.6.2(eslint@8.57.0) - eslint-plugin-perfectionist: 2.5.0(eslint@8.57.0)(typescript@5.3.3)(vue-eslint-parser@9.4.2) + eslint-plugin-perfectionist: 2.5.0(eslint@8.57.0)(typescript@5.4.2)(vue-eslint-parser@9.4.2) eslint-plugin-prettier: 5.1.3(eslint-config-prettier@9.1.0)(eslint@8.57.0)(prettier@3.2.5) eslint-plugin-unicorn: 51.0.1(eslint@8.57.0) eslint-plugin-unused-imports: 3.1.0(eslint@8.57.0) @@ -577,7 +577,7 @@ packages: jsonc-eslint-parser: 2.4.0 local-pkg: 0.5.0 prettier: 3.2.5 - typescript-eslint: 7.0.2(eslint@8.57.0)(typescript@5.3.3) + typescript-eslint: 7.0.2(eslint@8.57.0)(typescript@5.4.2) vue-eslint-parser: 9.4.2(eslint@8.57.0) yaml-eslint-parser: 1.2.2 transitivePeerDependencies: @@ -632,7 +632,7 @@ packages: resolution: {integrity: sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==} dev: true - /@typescript-eslint/eslint-plugin@7.0.2(@typescript-eslint/parser@7.0.2)(eslint@8.57.0)(typescript@5.3.3): + /@typescript-eslint/eslint-plugin@7.0.2(@typescript-eslint/parser@7.0.2)(eslint@8.57.0)(typescript@5.4.2): resolution: {integrity: sha512-/XtVZJtbaphtdrWjr+CJclaCVGPtOdBpFEnvtNf/jRV0IiEemRrL0qABex/nEt8isYcnFacm3nPHYQwL+Wb7qg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -644,10 +644,10 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.6.2 - '@typescript-eslint/parser': 7.0.2(eslint@8.57.0)(typescript@5.3.3) + '@typescript-eslint/parser': 7.0.2(eslint@8.57.0)(typescript@5.4.2) '@typescript-eslint/scope-manager': 7.0.2 - '@typescript-eslint/type-utils': 7.0.2(eslint@8.57.0)(typescript@5.3.3) - '@typescript-eslint/utils': 7.0.2(eslint@8.57.0)(typescript@5.3.3) + '@typescript-eslint/type-utils': 7.0.2(eslint@8.57.0)(typescript@5.4.2) + '@typescript-eslint/utils': 7.0.2(eslint@8.57.0)(typescript@5.4.2) '@typescript-eslint/visitor-keys': 7.0.2 debug: 4.3.4 eslint: 8.57.0 @@ -655,13 +655,13 @@ packages: ignore: 5.2.4 natural-compare: 1.4.0 semver: 7.6.0 - ts-api-utils: 1.0.1(typescript@5.3.3) - typescript: 5.3.3 + ts-api-utils: 1.0.1(typescript@5.4.2) + typescript: 5.4.2 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/parser@7.0.2(eslint@8.57.0)(typescript@5.3.3): + /@typescript-eslint/parser@7.0.2(eslint@8.57.0)(typescript@5.4.2): resolution: {integrity: sha512-GdwfDglCxSmU+QTS9vhz2Sop46ebNCXpPPvsByK7hu0rFGRHL+AusKQJ7SoN+LbLh6APFpQwHKmDSwN35Z700Q==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -673,11 +673,11 @@ packages: dependencies: '@typescript-eslint/scope-manager': 7.0.2 '@typescript-eslint/types': 7.0.2 - '@typescript-eslint/typescript-estree': 7.0.2(typescript@5.3.3) + '@typescript-eslint/typescript-estree': 7.0.2(typescript@5.4.2) '@typescript-eslint/visitor-keys': 7.0.2 debug: 4.3.4 eslint: 8.57.0 - typescript: 5.3.3 + typescript: 5.4.2 transitivePeerDependencies: - supports-color dev: true @@ -698,7 +698,7 @@ packages: '@typescript-eslint/visitor-keys': 7.0.2 dev: true - /@typescript-eslint/type-utils@7.0.2(eslint@8.57.0)(typescript@5.3.3): + /@typescript-eslint/type-utils@7.0.2(eslint@8.57.0)(typescript@5.4.2): resolution: {integrity: sha512-IKKDcFsKAYlk8Rs4wiFfEwJTQlHcdn8CLwLaxwd6zb8HNiMcQIFX9sWax2k4Cjj7l7mGS5N1zl7RCHOVwHq2VQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -708,12 +708,12 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 7.0.2(typescript@5.3.3) - '@typescript-eslint/utils': 7.0.2(eslint@8.57.0)(typescript@5.3.3) + '@typescript-eslint/typescript-estree': 7.0.2(typescript@5.4.2) + '@typescript-eslint/utils': 7.0.2(eslint@8.57.0)(typescript@5.4.2) debug: 4.3.4 eslint: 8.57.0 - ts-api-utils: 1.0.1(typescript@5.3.3) - typescript: 5.3.3 + ts-api-utils: 1.0.1(typescript@5.4.2) + typescript: 5.4.2 transitivePeerDependencies: - supports-color dev: true @@ -728,7 +728,7 @@ packages: engines: {node: ^16.0.0 || >=18.0.0} dev: true - /@typescript-eslint/typescript-estree@6.21.0(typescript@5.3.3): + /@typescript-eslint/typescript-estree@6.21.0(typescript@5.4.2): resolution: {integrity: sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -744,13 +744,13 @@ packages: is-glob: 4.0.3 minimatch: 9.0.3 semver: 7.6.0 - ts-api-utils: 1.0.1(typescript@5.3.3) - typescript: 5.3.3 + ts-api-utils: 1.0.1(typescript@5.4.2) + typescript: 5.4.2 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/typescript-estree@7.0.2(typescript@5.3.3): + /@typescript-eslint/typescript-estree@7.0.2(typescript@5.4.2): resolution: {integrity: sha512-3AMc8khTcELFWcKcPc0xiLviEvvfzATpdPj/DXuOGIdQIIFybf4DMT1vKRbuAEOFMwhWt7NFLXRkbjsvKZQyvw==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -766,13 +766,13 @@ packages: is-glob: 4.0.3 minimatch: 9.0.3 semver: 7.6.0 - ts-api-utils: 1.0.1(typescript@5.3.3) - typescript: 5.3.3 + ts-api-utils: 1.0.1(typescript@5.4.2) + typescript: 5.4.2 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/utils@6.21.0(eslint@8.57.0)(typescript@5.3.3): + /@typescript-eslint/utils@6.21.0(eslint@8.57.0)(typescript@5.4.2): resolution: {integrity: sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -783,7 +783,7 @@ packages: '@types/semver': 7.5.0 '@typescript-eslint/scope-manager': 6.21.0 '@typescript-eslint/types': 6.21.0 - '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.3.3) + '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.4.2) eslint: 8.57.0 semver: 7.6.0 transitivePeerDependencies: @@ -791,7 +791,7 @@ packages: - typescript dev: true - /@typescript-eslint/utils@7.0.2(eslint@8.57.0)(typescript@5.3.3): + /@typescript-eslint/utils@7.0.2(eslint@8.57.0)(typescript@5.4.2): resolution: {integrity: sha512-PZPIONBIB/X684bhT1XlrkjNZJIEevwkKDsdwfiu1WeqBxYEEdIgVDgm8/bbKHVu+6YOpeRqcfImTdImx/4Bsw==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -802,7 +802,7 @@ packages: '@types/semver': 7.5.0 '@typescript-eslint/scope-manager': 7.0.2 '@typescript-eslint/types': 7.0.2 - '@typescript-eslint/typescript-estree': 7.0.2(typescript@5.3.3) + '@typescript-eslint/typescript-estree': 7.0.2(typescript@5.4.2) eslint: 8.57.0 semver: 7.6.0 transitivePeerDependencies: @@ -842,11 +842,11 @@ packages: resolution: {integrity: sha512-qbPqL+46hf1/UelQOwUwpAuvm6buoss43DPYHOPdfNJ+NTWkSpATQMF0JKT04QE0QRQbHNSHdMe9ariG+IIlCw==} dev: true - /@unocss/eslint-plugin@0.58.5(eslint@8.57.0)(typescript@5.3.3): + /@unocss/eslint-plugin@0.58.5(eslint@8.57.0)(typescript@5.4.2): resolution: {integrity: sha512-QGB/Srml1XGiunuwbBmiVsXnkjjkRhg4/mTZ6HFkG1qZBAbsyE2QVxYJ6L7S4x4qdEgij2h2DK/Y90Cutwc7Mw==} engines: {node: '>=14'} dependencies: - '@typescript-eslint/utils': 6.21.0(eslint@8.57.0)(typescript@5.3.3) + '@typescript-eslint/utils': 6.21.0(eslint@8.57.0)(typescript@5.4.2) '@unocss/config': 0.58.5 '@unocss/core': 0.58.5 magic-string: 0.30.8 @@ -1472,7 +1472,7 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 7.0.2(eslint@8.57.0)(typescript@5.3.3) + '@typescript-eslint/parser': 7.0.2(eslint@8.57.0)(typescript@5.4.2) debug: 3.2.7 eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 @@ -1581,7 +1581,7 @@ packages: semver: 7.6.0 dev: true - /eslint-plugin-perfectionist@2.5.0(eslint@8.57.0)(typescript@5.3.3)(vue-eslint-parser@9.4.2): + /eslint-plugin-perfectionist@2.5.0(eslint@8.57.0)(typescript@5.4.2)(vue-eslint-parser@9.4.2): resolution: {integrity: sha512-F6XXcq4mKKUe/SREoMGQqzgw6cgCgf3pFzkFfQVIGtqD1yXVpQjnhTepzhBeZfxZwgMzR9HO4yH4CUhIQ2WBcQ==} peerDependencies: astro-eslint-parser: ^0.16.0 @@ -1599,7 +1599,7 @@ packages: vue-eslint-parser: optional: true dependencies: - '@typescript-eslint/utils': 6.21.0(eslint@8.57.0)(typescript@5.3.3) + '@typescript-eslint/utils': 6.21.0(eslint@8.57.0)(typescript@5.4.2) eslint: 8.57.0 minimatch: 9.0.3 natural-compare-lite: 1.4.0 @@ -3200,13 +3200,13 @@ packages: hasBin: true dev: true - /ts-api-utils@1.0.1(typescript@5.3.3): + /ts-api-utils@1.0.1(typescript@5.4.2): resolution: {integrity: sha512-lC/RGlPmwdrIBFTX59wwNzqh7aR2otPNPR/5brHZm/XKFYKsfqxihXUe9pU3JI+3vGkl+vyCoNNnPhJn3aLK1A==} engines: {node: '>=16.13.0'} peerDependencies: typescript: '>=4.2.0' dependencies: - typescript: 5.3.3 + typescript: 5.4.2 dev: true /ts-interface-checker@0.1.13: @@ -3217,7 +3217,7 @@ packages: resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} dev: true - /tsup@8.0.2(typescript@5.3.3): + /tsup@8.0.2(typescript@5.4.2): resolution: {integrity: sha512-NY8xtQXdH7hDUAZwcQdY/Vzlw9johQsaqf7iwZ6g1DOUlFYQ5/AtVAjTvihhEyeRlGo4dLRVHtrRaL35M1daqQ==} engines: {node: '>=18'} hasBin: true @@ -3250,7 +3250,7 @@ packages: source-map: 0.8.0-beta.0 sucrase: 3.32.0 tree-kill: 1.2.2 - typescript: 5.3.3 + typescript: 5.4.2 transitivePeerDependencies: - supports-color - ts-node @@ -3294,7 +3294,7 @@ packages: engines: {node: '>=8'} dev: true - /typescript-eslint@7.0.2(eslint@8.57.0)(typescript@5.3.3): + /typescript-eslint@7.0.2(eslint@8.57.0)(typescript@5.4.2): resolution: {integrity: sha512-Nsb+Dfi897ErE3CtVJYBECBQWPGEpCXLqLCQarBhFtyJsHnhA7O39GmtAmN3dmZ6bIp8tP5T+AOUrEdE07SBVg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -3304,16 +3304,16 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/eslint-plugin': 7.0.2(@typescript-eslint/parser@7.0.2)(eslint@8.57.0)(typescript@5.3.3) - '@typescript-eslint/parser': 7.0.2(eslint@8.57.0)(typescript@5.3.3) + '@typescript-eslint/eslint-plugin': 7.0.2(@typescript-eslint/parser@7.0.2)(eslint@8.57.0)(typescript@5.4.2) + '@typescript-eslint/parser': 7.0.2(eslint@8.57.0)(typescript@5.4.2) eslint: 8.57.0 - typescript: 5.3.3 + typescript: 5.4.2 transitivePeerDependencies: - supports-color dev: true - /typescript@5.3.3: - resolution: {integrity: sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==} + /typescript@5.4.2: + resolution: {integrity: sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==} engines: {node: '>=14.17'} hasBin: true dev: true diff --git a/tsconfig.json b/tsconfig.json index 6cfbc9b..5bff428 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,14 +1,15 @@ { "compilerOptions": { "target": "esnext", - "jsx": "preserve", "lib": ["es2022"], - "module": "esnext", + "moduleDetection": "force", + "module": "preserve", "moduleResolution": "bundler", "resolveJsonModule": true, "types": ["node"], "strict": true, "noUnusedLocals": true, + "noEmit": true, "esModuleInterop": true, "isolatedModules": true, "skipLibCheck": true