From f4ffc32d1b5d8d8560e4ce1918c1a730beef9f5f Mon Sep 17 00:00:00 2001 From: Sukka Date: Thu, 29 Aug 2024 08:39:01 +0800 Subject: [PATCH] chore: upgrade to TypeScript v5.5 (#83) Co-authored-by: Hiroki Osame --- package.json | 2 +- pnpm-lock.yaml | 122 +++++++++--------- .../parse-tsconfig/extends/merges.spec.ts | 6 +- .../extends/resolves/absolute-path.spec.ts | 9 +- .../extends/resolves/node-modules.spec.ts | 46 ++++--- .../extends/resolves/relative-path.spec.ts | 12 +- .../extends/resolves/symbolic-link.spec.ts | 3 +- tests/specs/parse-tsconfig/parses.spec.ts | 19 ++- 8 files changed, 129 insertions(+), 90 deletions(-) diff --git a/package.json b/package.json index 4ca609d..eed0eb6 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "slash": "^5.1.0", "tsx": "^4.15.7", "type-fest": "^4.20.1", - "typescript": "~5.2.0" + "typescript": "~5.5.4" }, "packageManager": "pnpm@9.2.0+sha512.98a80fd11c2e7096747762304106432b3ddc67dcf54b5a8c01c93f68a2cd5e05e6821849522a06fb76284d41a2660d5e334f2ee3bbf29183bf2e739b1dafa771" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8df521f..502a55f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -35,13 +35,13 @@ importers: version: 3.2.1 lintroll: specifier: ^1.6.1 - version: 1.6.1(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.2.2))(eslint@8.57.0))(typescript@5.2.2) + version: 1.6.1(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0))(typescript@5.5.4) manten: specifier: ^1.3.0 version: 1.3.0 pkgroll: specifier: ^2.1.1 - version: 2.1.1(typescript@5.2.2) + version: 2.1.1(typescript@5.5.4) slash: specifier: ^5.1.0 version: 5.1.0 @@ -52,8 +52,8 @@ importers: specifier: ^4.20.1 version: 4.20.1 typescript: - specifier: ~5.2.0 - version: 5.2.2 + specifier: ~5.5.4 + version: 5.5.4 packages: @@ -2205,8 +2205,8 @@ packages: resolution: {integrity: sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==} engines: {node: '>= 0.4'} - typescript@5.2.2: - resolution: {integrity: sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==} + typescript@5.5.4: + resolution: {integrity: sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==} engines: {node: '>=14.17'} hasBin: true @@ -2648,31 +2648,31 @@ snapshots: estraverse: 5.3.0 picomatch: 4.0.2 - '@stylistic/eslint-plugin-plus@1.8.1(eslint@8.57.0)(typescript@5.2.2)': + '@stylistic/eslint-plugin-plus@1.8.1(eslint@8.57.0)(typescript@5.5.4)': dependencies: '@types/eslint': 8.56.10 - '@typescript-eslint/utils': 6.21.0(eslint@8.57.0)(typescript@5.2.2) + '@typescript-eslint/utils': 6.21.0(eslint@8.57.0)(typescript@5.5.4) eslint: 8.57.0 transitivePeerDependencies: - supports-color - typescript - '@stylistic/eslint-plugin-ts@1.8.1(eslint@8.57.0)(typescript@5.2.2)': + '@stylistic/eslint-plugin-ts@1.8.1(eslint@8.57.0)(typescript@5.5.4)': dependencies: '@stylistic/eslint-plugin-js': 1.8.1(eslint@8.57.0) '@types/eslint': 8.56.10 - '@typescript-eslint/utils': 6.21.0(eslint@8.57.0)(typescript@5.2.2) + '@typescript-eslint/utils': 6.21.0(eslint@8.57.0)(typescript@5.5.4) eslint: 8.57.0 transitivePeerDependencies: - supports-color - typescript - '@stylistic/eslint-plugin@1.8.1(eslint@8.57.0)(typescript@5.2.2)': + '@stylistic/eslint-plugin@1.8.1(eslint@8.57.0)(typescript@5.5.4)': dependencies: '@stylistic/eslint-plugin-js': 1.8.1(eslint@8.57.0) '@stylistic/eslint-plugin-jsx': 1.8.1(eslint@8.57.0) - '@stylistic/eslint-plugin-plus': 1.8.1(eslint@8.57.0)(typescript@5.2.2) - '@stylistic/eslint-plugin-ts': 1.8.1(eslint@8.57.0)(typescript@5.2.2) + '@stylistic/eslint-plugin-plus': 1.8.1(eslint@8.57.0)(typescript@5.5.4) + '@stylistic/eslint-plugin-ts': 1.8.1(eslint@8.57.0)(typescript@5.5.4) '@types/eslint': 8.56.10 eslint: 8.57.0 transitivePeerDependencies: @@ -2728,34 +2728,34 @@ snapshots: dependencies: '@types/yargs-parser': 21.0.3 - '@typescript-eslint/eslint-plugin@7.13.1(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.2.2))(eslint@8.57.0)(typescript@5.2.2)': + '@typescript-eslint/eslint-plugin@7.13.1(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4)': dependencies: '@eslint-community/regexpp': 4.10.1 - '@typescript-eslint/parser': 7.13.1(eslint@8.57.0)(typescript@5.2.2) + '@typescript-eslint/parser': 7.13.1(eslint@8.57.0)(typescript@5.5.4) '@typescript-eslint/scope-manager': 7.13.1 - '@typescript-eslint/type-utils': 7.13.1(eslint@8.57.0)(typescript@5.2.2) - '@typescript-eslint/utils': 7.13.1(eslint@8.57.0)(typescript@5.2.2) + '@typescript-eslint/type-utils': 7.13.1(eslint@8.57.0)(typescript@5.5.4) + '@typescript-eslint/utils': 7.13.1(eslint@8.57.0)(typescript@5.5.4) '@typescript-eslint/visitor-keys': 7.13.1 eslint: 8.57.0 graphemer: 1.4.0 ignore: 5.3.1 natural-compare: 1.4.0 - ts-api-utils: 1.3.0(typescript@5.2.2) + ts-api-utils: 1.3.0(typescript@5.5.4) optionalDependencies: - typescript: 5.2.2 + typescript: 5.5.4 transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.2.2)': + '@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.5.4)': dependencies: '@typescript-eslint/scope-manager': 7.13.1 '@typescript-eslint/types': 7.13.1 - '@typescript-eslint/typescript-estree': 7.13.1(typescript@5.2.2) + '@typescript-eslint/typescript-estree': 7.13.1(typescript@5.5.4) '@typescript-eslint/visitor-keys': 7.13.1 debug: 4.3.5 eslint: 8.57.0 optionalDependencies: - typescript: 5.2.2 + typescript: 5.5.4 transitivePeerDependencies: - supports-color @@ -2769,15 +2769,15 @@ snapshots: '@typescript-eslint/types': 7.13.1 '@typescript-eslint/visitor-keys': 7.13.1 - '@typescript-eslint/type-utils@7.13.1(eslint@8.57.0)(typescript@5.2.2)': + '@typescript-eslint/type-utils@7.13.1(eslint@8.57.0)(typescript@5.5.4)': dependencies: - '@typescript-eslint/typescript-estree': 7.13.1(typescript@5.2.2) - '@typescript-eslint/utils': 7.13.1(eslint@8.57.0)(typescript@5.2.2) + '@typescript-eslint/typescript-estree': 7.13.1(typescript@5.5.4) + '@typescript-eslint/utils': 7.13.1(eslint@8.57.0)(typescript@5.5.4) debug: 4.3.5 eslint: 8.57.0 - ts-api-utils: 1.3.0(typescript@5.2.2) + ts-api-utils: 1.3.0(typescript@5.5.4) optionalDependencies: - typescript: 5.2.2 + typescript: 5.5.4 transitivePeerDependencies: - supports-color @@ -2785,7 +2785,7 @@ snapshots: '@typescript-eslint/types@7.13.1': {} - '@typescript-eslint/typescript-estree@6.21.0(typescript@5.2.2)': + '@typescript-eslint/typescript-estree@6.21.0(typescript@5.5.4)': dependencies: '@typescript-eslint/types': 6.21.0 '@typescript-eslint/visitor-keys': 6.21.0 @@ -2794,13 +2794,13 @@ snapshots: is-glob: 4.0.3 minimatch: 9.0.3 semver: 7.6.2 - ts-api-utils: 1.3.0(typescript@5.2.2) + ts-api-utils: 1.3.0(typescript@5.5.4) optionalDependencies: - typescript: 5.2.2 + typescript: 5.5.4 transitivePeerDependencies: - supports-color - '@typescript-eslint/typescript-estree@7.13.1(typescript@5.2.2)': + '@typescript-eslint/typescript-estree@7.13.1(typescript@5.5.4)': dependencies: '@typescript-eslint/types': 7.13.1 '@typescript-eslint/visitor-keys': 7.13.1 @@ -2809,32 +2809,32 @@ snapshots: is-glob: 4.0.3 minimatch: 9.0.4 semver: 7.6.2 - ts-api-utils: 1.3.0(typescript@5.2.2) + ts-api-utils: 1.3.0(typescript@5.5.4) optionalDependencies: - typescript: 5.2.2 + typescript: 5.5.4 transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@6.21.0(eslint@8.57.0)(typescript@5.2.2)': + '@typescript-eslint/utils@6.21.0(eslint@8.57.0)(typescript@5.5.4)': dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) '@types/json-schema': 7.0.15 '@types/semver': 7.5.8 '@typescript-eslint/scope-manager': 6.21.0 '@typescript-eslint/types': 6.21.0 - '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.2.2) + '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.5.4) eslint: 8.57.0 semver: 7.6.2 transitivePeerDependencies: - supports-color - typescript - '@typescript-eslint/utils@7.13.1(eslint@8.57.0)(typescript@5.2.2)': + '@typescript-eslint/utils@7.13.1(eslint@8.57.0)(typescript@5.5.4)': dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) '@typescript-eslint/scope-manager': 7.13.1 '@typescript-eslint/types': 7.13.1 - '@typescript-eslint/typescript-estree': 7.13.1(typescript@5.2.2) + '@typescript-eslint/typescript-estree': 7.13.1(typescript@5.5.4) eslint: 8.57.0 transitivePeerDependencies: - supports-color @@ -3310,13 +3310,13 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.2.2))(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.2.2))(eslint@8.57.0))(eslint@8.57.0): + eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.5.4))(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0))(eslint@8.57.0): dependencies: debug: 4.3.5 enhanced-resolve: 5.17.0 eslint: 8.57.0 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.2.2))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.2.2))(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.2.2))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.2.2))(eslint@8.57.0) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.5.4))(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0) fast-glob: 3.3.2 get-tsconfig: 4.7.5 is-core-module: 2.14.0 @@ -3327,23 +3327,23 @@ snapshots: - eslint-import-resolver-webpack - supports-color - eslint-module-utils@2.8.1(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.2.2))(eslint-import-resolver-node@0.3.9)(eslint@8.57.0): + eslint-module-utils@2.8.1(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint@8.57.0): dependencies: debug: 3.2.7 optionalDependencies: - '@typescript-eslint/parser': 7.13.1(eslint@8.57.0)(typescript@5.2.2) + '@typescript-eslint/parser': 7.13.1(eslint@8.57.0)(typescript@5.5.4) eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 transitivePeerDependencies: - supports-color - eslint-module-utils@2.8.1(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.2.2))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.2.2))(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.2.2))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0): + eslint-module-utils@2.8.1(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.5.4))(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0): dependencies: debug: 3.2.7 optionalDependencies: - '@typescript-eslint/parser': 7.13.1(eslint@8.57.0)(typescript@5.2.2) + '@typescript-eslint/parser': 7.13.1(eslint@8.57.0)(typescript@5.5.4) eslint: 8.57.0 - eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.2.2))(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.2.2))(eslint@8.57.0))(eslint@8.57.0) + eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.5.4))(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0))(eslint@8.57.0) transitivePeerDependencies: - supports-color @@ -3354,9 +3354,9 @@ snapshots: eslint: 8.57.0 eslint-compat-utils: 0.5.1(eslint@8.57.0) - eslint-plugin-import-x@0.5.1(eslint@8.57.0)(typescript@5.2.2): + eslint-plugin-import-x@0.5.1(eslint@8.57.0)(typescript@5.5.4): dependencies: - '@typescript-eslint/utils': 7.13.1(eslint@8.57.0)(typescript@5.2.2) + '@typescript-eslint/utils': 7.13.1(eslint@8.57.0)(typescript@5.5.4) debug: 4.3.5 doctrine: 3.0.0 eslint: 8.57.0 @@ -3370,7 +3370,7 @@ snapshots: - supports-color - typescript - eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.2.2))(eslint@8.57.0): + eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0): dependencies: array-includes: 3.1.8 array.prototype.findlastindex: 1.2.5 @@ -3380,7 +3380,7 @@ snapshots: doctrine: 2.1.0 eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.2.2))(eslint-import-resolver-node@0.3.9)(eslint@8.57.0) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint@8.57.0) hasown: 2.0.2 is-core-module: 2.14.0 is-glob: 4.0.3 @@ -3391,7 +3391,7 @@ snapshots: semver: 6.3.1 tsconfig-paths: 3.15.0 optionalDependencies: - '@typescript-eslint/parser': 7.13.1(eslint@8.57.0)(typescript@5.2.2) + '@typescript-eslint/parser': 7.13.1(eslint@8.57.0)(typescript@5.5.4) transitivePeerDependencies: - eslint-import-resolver-typescript - eslint-import-resolver-webpack @@ -4052,18 +4052,18 @@ snapshots: lines-and-columns@1.2.4: {} - lintroll@1.6.1(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.2.2))(eslint@8.57.0))(typescript@5.2.2): + lintroll@1.6.1(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0))(typescript@5.5.4): dependencies: '@eslint-community/eslint-plugin-eslint-comments': 4.3.0(eslint@8.57.0) '@eslint/js': 8.57.0 - '@stylistic/eslint-plugin': 1.8.1(eslint@8.57.0)(typescript@5.2.2) - '@typescript-eslint/eslint-plugin': 7.13.1(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.2.2))(eslint@8.57.0)(typescript@5.2.2) - '@typescript-eslint/parser': 7.13.1(eslint@8.57.0)(typescript@5.2.2) + '@stylistic/eslint-plugin': 1.8.1(eslint@8.57.0)(typescript@5.5.4) + '@typescript-eslint/eslint-plugin': 7.13.1(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4) + '@typescript-eslint/parser': 7.13.1(eslint@8.57.0)(typescript@5.5.4) cleye: 1.3.2 confusing-browser-globals: 1.0.11 eslint: 8.57.0 - eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.2.2))(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.2.2))(eslint@8.57.0))(eslint@8.57.0) - eslint-plugin-import-x: 0.5.1(eslint@8.57.0)(typescript@5.2.2) + eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.5.4))(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.13.1(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0))(eslint@8.57.0) + eslint-plugin-import-x: 0.5.1(eslint@8.57.0)(typescript@5.5.4) eslint-plugin-jsonc: 2.16.0(eslint@8.57.0) eslint-plugin-markdown: 4.0.1(eslint@8.57.0) eslint-plugin-n: 17.9.0(eslint@8.57.0) @@ -4315,7 +4315,7 @@ snapshots: picomatch@4.0.2: {} - pkgroll@2.1.1(typescript@5.2.2): + pkgroll@2.1.1(typescript@5.5.4): dependencies: '@rollup/plugin-alias': 5.1.0(rollup@4.18.0) '@rollup/plugin-commonjs': 25.0.8(rollup@4.18.0) @@ -4328,7 +4328,7 @@ snapshots: magic-string: 0.30.10 rollup: 4.18.0 optionalDependencies: - typescript: 5.2.2 + typescript: 5.5.4 pluralize@8.0.0: {} @@ -4610,9 +4610,9 @@ snapshots: dependencies: is-number: 7.0.0 - ts-api-utils@1.3.0(typescript@5.2.2): + ts-api-utils@1.3.0(typescript@5.5.4): dependencies: - typescript: 5.2.2 + typescript: 5.5.4 tsconfig-paths@3.15.0: dependencies: @@ -4678,7 +4678,7 @@ snapshots: is-typed-array: 1.1.13 possible-typed-array-names: 1.0.0 - typescript@5.2.2: {} + typescript@5.5.4: {} unbox-primitive@1.0.2: dependencies: diff --git a/tests/specs/parse-tsconfig/extends/merges.spec.ts b/tests/specs/parse-tsconfig/extends/merges.spec.ts index 2de2a35..0ab2fd7 100644 --- a/tests/specs/parse-tsconfig/extends/merges.spec.ts +++ b/tests/specs/parse-tsconfig/extends/merges.spec.ts @@ -111,7 +111,8 @@ export default testSuite(({ describe }) => { const tsconfig = parseTsconfig(fixture.getPath('tsconfig.json')); - expect(tsconfig).toStrictEqual(expectedTsconfig); + // TODO: TS 5.5 --showConfig returns extra default fields + expect(expectedTsconfig).toMatchObject(tsconfig); }); describe('files', ({ test }) => { @@ -423,7 +424,8 @@ export default testSuite(({ describe }) => { delete expectedTsconfig.files; const tsconfig = parseTsconfig(fixture.getPath('tsconfig.json')); - expect(tsconfig).toStrictEqual(expectedTsconfig); + // TODO: TS 5.5 --showConfig returns extra default fields + expect(expectedTsconfig).toMatchObject(tsconfig); }); test('watchOptions', async () => { diff --git a/tests/specs/parse-tsconfig/extends/resolves/absolute-path.spec.ts b/tests/specs/parse-tsconfig/extends/resolves/absolute-path.spec.ts index 6d024c6..b5a4223 100644 --- a/tests/specs/parse-tsconfig/extends/resolves/absolute-path.spec.ts +++ b/tests/specs/parse-tsconfig/extends/resolves/absolute-path.spec.ts @@ -23,7 +23,8 @@ export default testSuite(({ describe }) => { delete expectedTsconfig.files; const tsconfig = parseTsconfig(fixture.getPath('tsconfig.json')); - expect(tsconfig).toStrictEqual(expectedTsconfig); + // TODO: TS 5.5 --showConfig returns extra default fields + expect(expectedTsconfig).toMatchObject(tsconfig); }); test('no extension', async () => { @@ -44,7 +45,8 @@ export default testSuite(({ describe }) => { delete expectedTsconfig.files; const tsconfig = parseTsconfig(fixture.getPath('tsconfig.json')); - expect(tsconfig).toStrictEqual(expectedTsconfig); + // TODO: TS 5.5 --showConfig returns extra default fields + expect(expectedTsconfig).toMatchObject(tsconfig); }); test('arbitrary extension', async () => { @@ -65,7 +67,8 @@ export default testSuite(({ describe }) => { delete expectedTsconfig.files; const tsconfig = parseTsconfig(fixture.getPath('tsconfig.json')); - expect(tsconfig).toStrictEqual(expectedTsconfig); + // TODO: TS 5.5 --showConfig returns extra default fields + expect(expectedTsconfig).toMatchObject(tsconfig); }); }); }); diff --git a/tests/specs/parse-tsconfig/extends/resolves/node-modules.spec.ts b/tests/specs/parse-tsconfig/extends/resolves/node-modules.spec.ts index a3fa574..abbcc0d 100644 --- a/tests/specs/parse-tsconfig/extends/resolves/node-modules.spec.ts +++ b/tests/specs/parse-tsconfig/extends/resolves/node-modules.spec.ts @@ -59,7 +59,8 @@ export default testSuite(({ describe }) => { delete expectedTsconfig.files; const tsconfig = parseTsconfig(fixture.getPath('tsconfig.json')); - expect(tsconfig).toStrictEqual(expectedTsconfig); + // TODO: TS 5.5 --showConfig returns extra default fields + expect(expectedTsconfig).toMatchObject(tsconfig); }); test('without package.json', async () => { @@ -80,7 +81,8 @@ export default testSuite(({ describe }) => { delete expectedTsconfig.files; const tsconfig = parseTsconfig(fixture.getPath('tsconfig.json')); - expect(tsconfig).toStrictEqual(expectedTsconfig); + // TODO: TS 5.5 --showConfig returns extra default fields + expect(expectedTsconfig).toMatchObject(tsconfig); }); test('ignores invalid package.json', async () => { @@ -160,7 +162,8 @@ export default testSuite(({ describe }) => { delete expectedTsconfig.files; const tsconfig = parseTsconfig(fixture.getPath('tsconfig.json')); - expect(tsconfig).toStrictEqual(expectedTsconfig); + // TODO: TS 5.5 --showConfig returns extra default fields + expect(expectedTsconfig).toMatchObject(tsconfig); }); test('empty object package.json', async () => { @@ -188,7 +191,8 @@ export default testSuite(({ describe }) => { delete expectedTsconfig.files; const tsconfig = parseTsconfig(fixture.getPath('tsconfig.json')); - expect(tsconfig).toStrictEqual(expectedTsconfig); + // TODO: TS 5.5 --showConfig returns extra default fields + expect(expectedTsconfig).toMatchObject(tsconfig); }); }); @@ -211,7 +215,8 @@ export default testSuite(({ describe }) => { delete expectedTsconfig.files; const tsconfig = parseTsconfig(fixture.getPath('tsconfig.json')); - expect(tsconfig).toStrictEqual(expectedTsconfig); + // TODO: TS 5.5 --showConfig returns extra default fields + expect(expectedTsconfig).toMatchObject(tsconfig); }); test('implicit .json extension', async () => { @@ -232,7 +237,8 @@ export default testSuite(({ describe }) => { delete expectedTsconfig.files; const tsconfig = parseTsconfig(fixture.getPath('tsconfig.json')); - expect(tsconfig).toStrictEqual(expectedTsconfig); + // TODO: TS 5.5 --showConfig returns extra default fields + expect(expectedTsconfig).toMatchObject(tsconfig); }); test('prefers implicit .json over directory', async () => { @@ -321,7 +327,8 @@ export default testSuite(({ describe }) => { delete expectedTsconfig.files; const tsconfig = parseTsconfig(fixture.getPath('tsconfig.json')); - expect(tsconfig).toStrictEqual(expectedTsconfig); + // TODO: TS 5.5 --showConfig returns extra default fields + expect(expectedTsconfig).toMatchObject(tsconfig); }); test('extends dependency package far', async () => { @@ -345,7 +352,8 @@ export default testSuite(({ describe }) => { delete expectedTsconfig.files; const tsconfig = parseTsconfig(path.join(fixturePath, 'tsconfig.json')); - expect(tsconfig).toStrictEqual(expectedTsconfig); + // TODO: TS 5.5 --showConfig returns extra default fields + expect(expectedTsconfig).toMatchObject(tsconfig); }); // https://github.com/privatenumber/get-tsconfig/issues/76 @@ -417,7 +425,8 @@ export default testSuite(({ describe }) => { delete expectedTsconfig.files; const tsconfig = parseTsconfig(fixture.getPath('tsconfig.json')); - expect(tsconfig).toStrictEqual(expectedTsconfig); + // TODO: TS 5.5 --showConfig returns extra default fields + expect(expectedTsconfig).toMatchObject(tsconfig); }); test('reads nested package.json#tsconfig', async () => { @@ -454,7 +463,8 @@ export default testSuite(({ describe }) => { delete expectedTsconfig.files; const tsconfig = parseTsconfig(fixture.getPath('tsconfig.json')); - expect(tsconfig).toStrictEqual(expectedTsconfig); + // TODO: TS 5.5 --showConfig returns extra default fields + expect(expectedTsconfig).toMatchObject(tsconfig); }); }); @@ -507,7 +517,8 @@ export default testSuite(({ describe }) => { delete expectedTsconfig.files; const tsconfig = parseTsconfig(fixture.getPath('tsconfig.json')); - expect(tsconfig).toStrictEqual(expectedTsconfig); + // TODO: TS 5.5 --showConfig returns extra default fields + expect(expectedTsconfig).toMatchObject(tsconfig); }); test('subpath', async () => { @@ -540,7 +551,9 @@ export default testSuite(({ describe }) => { delete expectedTsconfig.files; const tsconfig = parseTsconfig(fixture.getPath('tsconfig.json')); - expect(tsconfig).toStrictEqual(expectedTsconfig); + + // TODO: TS 5.5 --showConfig returns extra default fields + expect(expectedTsconfig).toMatchObject(tsconfig); }); describe('conditions', ({ test }) => { @@ -576,7 +589,8 @@ export default testSuite(({ describe }) => { delete expectedTsconfig.files; const tsconfig = parseTsconfig(fixture.getPath('tsconfig.json')); - expect(tsconfig).toStrictEqual(expectedTsconfig); + // TODO: TS 5.5 --showConfig returns extra default fields + expect(expectedTsconfig).toMatchObject(tsconfig); }); test('types', async () => { @@ -611,7 +625,8 @@ export default testSuite(({ describe }) => { delete expectedTsconfig.files; const tsconfig = parseTsconfig(fixture.getPath('tsconfig.json')); - expect(tsconfig).toStrictEqual(expectedTsconfig); + // TODO: TS 5.5 --showConfig returns extra default fields + expect(expectedTsconfig).toMatchObject(tsconfig); }); test('missing condition should fail', async () => { @@ -796,7 +811,8 @@ export default testSuite(({ describe }) => { delete expectedTsconfig.files; const tsconfig = parseTsconfig(fixture.getPath('tsconfig.json')); - expect(tsconfig).toStrictEqual(expectedTsconfig); + // TODO: TS 5.5 --showConfig returns extra default fields + expect(expectedTsconfig).toMatchObject(tsconfig); }); }); }); diff --git a/tests/specs/parse-tsconfig/extends/resolves/relative-path.spec.ts b/tests/specs/parse-tsconfig/extends/resolves/relative-path.spec.ts index a828f12..6aaf0c2 100644 --- a/tests/specs/parse-tsconfig/extends/resolves/relative-path.spec.ts +++ b/tests/specs/parse-tsconfig/extends/resolves/relative-path.spec.ts @@ -27,7 +27,8 @@ export default testSuite(({ describe }) => { delete expectedTsconfig.files; const tsconfig = parseTsconfig(fixture.getPath('tsconfig.json')); - expect(tsconfig).toStrictEqual(expectedTsconfig); + // TODO: TS 5.5 --showConfig returns extra default fields + expect(expectedTsconfig).toMatchObject(tsconfig); }); test('prefers exact match (extensionless file)', async () => { @@ -57,7 +58,8 @@ export default testSuite(({ describe }) => { delete expectedTsconfig.files; const tsconfig = parseTsconfig(fixture.getPath('tsconfig.json')); - expect(tsconfig).toStrictEqual(expectedTsconfig); + // TODO: TS 5.5 --showConfig returns extra default fields + expect(expectedTsconfig).toMatchObject(tsconfig); }); test('arbitrary extension', async () => { @@ -81,7 +83,8 @@ export default testSuite(({ describe }) => { delete expectedTsconfig.files; const tsconfig = parseTsconfig(fixture.getPath('tsconfig.json')); - expect(tsconfig).toStrictEqual(expectedTsconfig); + // TODO: TS 5.5 --showConfig returns extra default fields + expect(expectedTsconfig).toMatchObject(tsconfig); }); test('parent directory', async () => { @@ -108,7 +111,8 @@ export default testSuite(({ describe }) => { delete expectedTsconfig.files; const tsconfig = parseTsconfig(path.join(testDirectory, 'tsconfig.json')); - expect(tsconfig).toStrictEqual(expectedTsconfig); + // TODO: TS 5.5 --showConfig returns extra default fields + expect(expectedTsconfig).toMatchObject(tsconfig); }); test('shoud not resolve directory', async () => { diff --git a/tests/specs/parse-tsconfig/extends/resolves/symbolic-link.spec.ts b/tests/specs/parse-tsconfig/extends/resolves/symbolic-link.spec.ts index a899b10..8d7601c 100644 --- a/tests/specs/parse-tsconfig/extends/resolves/symbolic-link.spec.ts +++ b/tests/specs/parse-tsconfig/extends/resolves/symbolic-link.spec.ts @@ -9,7 +9,8 @@ const validate = async (directoryPath: string) => { delete expectedTsconfig.files; const tsconfig = parseTsconfig(path.join(directoryPath, 'tsconfig.json')); - expect(tsconfig).toStrictEqual(expectedTsconfig); + // TODO: TS 5.5 --showConfig returns extra default fields + expect(expectedTsconfig).toMatchObject(tsconfig); }; export default testSuite(({ describe }) => { diff --git a/tests/specs/parse-tsconfig/parses.spec.ts b/tests/specs/parse-tsconfig/parses.spec.ts index 6ca944d..8f1f649 100644 --- a/tests/specs/parse-tsconfig/parses.spec.ts +++ b/tests/specs/parse-tsconfig/parses.spec.ts @@ -84,7 +84,13 @@ export default testSuite(({ describe }) => { const expectedTsconfig = await getTscTsconfig(fixture.path); delete expectedTsconfig.files; - expect(parsedTsconfig).toStrictEqual(expectedTsconfig); + // TODO: TS 5.5 resolve excludes paths + if (expectedTsconfig.exclude) { + expectedTsconfig.exclude = expectedTsconfig.exclude.map(excludePath => excludePath.split('/').pop()!); + } + + // TODO: TS 5.5 --showConfig returns extra default fields + expect(expectedTsconfig).toMatchObject(parsedTsconfig); }); describe('baseUrl', ({ test }) => { @@ -150,12 +156,19 @@ export default testSuite(({ describe }) => { const expectedTsconfig = await getTscTsconfig(fixture.path); delete expectedTsconfig.files; - expect(parsedTsconfig).toStrictEqual(expectedTsconfig); + // TODO: TS 5.5 resolve excludes paths + if (expectedTsconfig.exclude) { + expectedTsconfig.exclude = expectedTsconfig.exclude.map(excludePath => excludePath.split('/').pop()!); + } + + // TODO: TS 5.5 --showConfig returns extra default fields + expect(expectedTsconfig).toMatchObject(parsedTsconfig); const parsedTsconfigCached = parseTsconfig(fixture.getPath('tsconfig.json'), cache); expect(cache.size).toBe(1); - expect(parsedTsconfigCached).toStrictEqual(expectedTsconfig); + // TODO: TS 5.5 --showConfig returns extra default fields + expect(expectedTsconfig).toMatchObject(parsedTsconfigCached); }); }); });