From 01158b01970c69a592799a3a8c66828abd991bed Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Mon, 17 Apr 2023 12:15:43 +0930 Subject: [PATCH] chore: bump minimum TS to 4.3.5 --- .gitignore | 1 + docs/maintenance/Versioning.mdx | 2 +- package.json | 4 +- packages/parser/package.json | 8 +-- packages/scope-manager/package.json | 2 +- packages/scope-manager/project.json | 9 ++- packages/type-utils/package.json | 8 +-- packages/types/package.json | 8 +-- packages/typescript-estree/package.json | 8 +-- .../src/parseSettings/warnAboutTSVersion.ts | 4 +- .../typescript-estree/src/version-check.ts | 1 - packages/utils/package.json | 10 +-- packages/visitor-keys/package.json | 8 +-- ...13-announcing-typescript-eslint-v6-beta.md | 2 +- .../components/editor/useSandboxServices.ts | 2 +- yarn.lock | 68 ++----------------- 16 files changed, 42 insertions(+), 103 deletions(-) diff --git a/.gitignore b/.gitignore index 00e70d846c7b..fb6fcf441bdd 100644 --- a/.gitignore +++ b/.gitignore @@ -84,6 +84,7 @@ _ts4.2 # the downlevel-dts output folders _ts3.4 _ts4.2 +_ts4.3 # Files copied as part of the build packages/types/src/generated/**/*.ts diff --git a/docs/maintenance/Versioning.mdx b/docs/maintenance/Versioning.mdx index a2dc37ab8f8d..1070aad96b73 100644 --- a/docs/maintenance/Versioning.mdx +++ b/docs/maintenance/Versioning.mdx @@ -52,7 +52,7 @@ Support for specific Current status releases are considered periodically. ### TypeScript -> The version range of TypeScript currently supported is `>=4.2.4 <5.1.0`. +> The version range of TypeScript currently supported is `>=4.3.5 <5.1.0`. Note that we mirror [DefinitelyTyped's version support window](https://github.com/DefinitelyTyped/DefinitelyTyped/#support-window) - meaning we only support versions of TypeScript less than 2 years old. diff --git a/package.json b/package.json index e4aea0323670..670cc227cd68 100644 --- a/package.json +++ b/package.json @@ -114,10 +114,10 @@ "ts-node": "10.7.0", "tslint": "^6.1.3", "tsx": "^3.12.1", - "typescript": ">=4.2.4 <5.1.0" + "typescript": ">=4.3.5 <5.1.0" }, "resolutions": { - "typescript": "~5.0.2", + "typescript": "~5.0.4", "@types/node": "^18.11.9", "@jest/reporters": "^29", "@jest/test-result": "^29", diff --git a/packages/parser/package.json b/packages/parser/package.json index 45cff8c1ddac..dbbf69f36c49 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -4,7 +4,7 @@ "description": "An ESLint custom parser which leverages TypeScript ESTree", "files": [ "dist", - "_ts4.2", + "_ts4.3", "README.md", "LICENSE" ], @@ -39,9 +39,9 @@ ], "scripts": { "build": "tsc -b tsconfig.build.json", - "postbuild": "downlevel-dts dist _ts4.2/dist --to=4.2", + "postbuild": "downlevel-dts dist _ts4.3/dist --to=4.3", "clean": "tsc -b tsconfig.build.json --clean", - "postclean": "rimraf dist && rimraf _ts3.4 && rimraf _ts4.2 && rimraf coverage", + "postclean": "rimraf dist && rimraf _ts4.3 && rimraf coverage", "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", "lint": "nx lint", "test": "jest --coverage", @@ -74,7 +74,7 @@ "typesVersions": { "<4.7": { "*": [ - "_ts4.2/*" + "_ts4.3/*" ] } } diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index cbafceaddbc5..1ccd589677d6 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -65,7 +65,7 @@ "typesVersions": { "<4.7": { "*": [ - "_ts4.2/*" + "_ts4.3/*" ] } } diff --git a/packages/scope-manager/project.json b/packages/scope-manager/project.json index 3fd3a9e3aa88..e3787c686dc7 100644 --- a/packages/scope-manager/project.json +++ b/packages/scope-manager/project.json @@ -6,14 +6,14 @@ "targets": { "build": { "executor": "nx:run-commands", - "outputs": ["{projectRoot}/dist", "{projectRoot}/_ts4.2"], + "outputs": ["{projectRoot}/dist", "{projectRoot}/_ts4.3"], "options": { "parallel": false, "cwd": "packages/scope-manager", "commands": [ - "rimraf _ts4.2", + "rimraf _ts4.3", "tsc -b tsconfig.build.json", - "downlevel-dts dist _ts4.2/dist --to=4.2" + "downlevel-dts dist _ts4.3/dist --to=4.3" ] } }, @@ -36,8 +36,7 @@ "commands": [ "tsc -b tsconfig.build.json --clean", "rimraf dist", - "rimraf _ts4.2", - "rimraf _ts3.4", + "rimraf _ts4.3", "rimraf coverage" ] } diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index b3fd65270240..33caa9e47023 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -4,7 +4,7 @@ "description": "Type utilities for working with TypeScript + ESLint together", "files": [ "dist", - "_ts4.2", + "_ts4.3", "package.json", "README.md", "LICENSE" @@ -36,9 +36,9 @@ ], "scripts": { "build": "tsc -b tsconfig.build.json", - "postbuild": "downlevel-dts dist _ts4.2/dist --to=4.2", + "postbuild": "downlevel-dts dist _ts4.3/dist --to=4.3", "clean": "tsc -b tsconfig.build.json --clean", - "postclean": "rimraf dist && rimraf _ts3.4 && rimraf _ts4.2 && rimraf coverage", + "postclean": "rimraf dist && rimraf _ts3.4 && rimraf _ts4.3 && rimraf coverage", "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", "lint": "nx lint", "test": "jest --coverage", @@ -70,7 +70,7 @@ "typesVersions": { "<4.7": { "*": [ - "_ts4.2/*" + "_ts4.3/*" ] } } diff --git a/packages/types/package.json b/packages/types/package.json index 6c823f57ecf2..06461fdffc0e 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -4,7 +4,7 @@ "description": "Types for the TypeScript-ESTree AST spec", "files": [ "dist", - "_ts4.2", + "_ts4.3", "package.json", "README.md", "LICENSE" @@ -37,9 +37,9 @@ "scripts": { "copy-ast-spec": "tsx ./tools/copy-ast-spec.ts", "build": "tsc -b tsconfig.build.json", - "postbuild": "downlevel-dts dist _ts4.2/dist --to=4.2", + "postbuild": "downlevel-dts dist _ts4.3/dist --to=4.3", "clean": "tsc -b tsconfig.build.json --clean", - "postclean": "rimraf dist && rimraf src/generated && rimraf _ts3.4 && rimraf _ts4.2 && rimraf coverage", + "postclean": "rimraf dist && rimraf src/generated && rimraf _ts3.4 && rimraf _ts4.3 && rimraf coverage", "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", "generate-lib": "nx run scope-manager:generate-lib", "lint": "nx lint", @@ -82,7 +82,7 @@ "typesVersions": { "<4.7": { "*": [ - "_ts4.2/*" + "_ts4.3/*" ] } } diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index 0ed646d735a3..cec89e11d0e9 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -4,7 +4,7 @@ "description": "A parser that converts TypeScript source code into an ESTree compatible form", "files": [ "dist", - "_ts4.2", + "_ts4.3", "README.md", "LICENSE" ], @@ -43,9 +43,9 @@ ], "scripts": { "build": "tsc -b tsconfig.build.json", - "postbuild": "downlevel-dts dist _ts4.2/dist --to=4.2", + "postbuild": "downlevel-dts dist _ts4.3/dist --to=4.3", "clean": "tsc -b tsconfig.build.json --clean", - "postclean": "rimraf dist && rimraf _ts3.4 && rimraf _ts4.2 && rimraf coverage", + "postclean": "rimraf dist && rimraf _ts4.3 && rimraf coverage", "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", "lint": "nx lint", "test": "jest --coverage", @@ -87,7 +87,7 @@ "typesVersions": { "<4.7": { "*": [ - "_ts4.2/*" + "_ts4.3/*" ] } } diff --git a/packages/typescript-estree/src/parseSettings/warnAboutTSVersion.ts b/packages/typescript-estree/src/parseSettings/warnAboutTSVersion.ts index d83384a4b3ff..975a8f107658 100644 --- a/packages/typescript-estree/src/parseSettings/warnAboutTSVersion.ts +++ b/packages/typescript-estree/src/parseSettings/warnAboutTSVersion.ts @@ -6,13 +6,13 @@ import type { ParseSettings } from './index'; * This needs to be kept in sync with /docs/maintenance/Versioning.md * in the typescript-eslint monorepo */ -const SUPPORTED_TYPESCRIPT_VERSIONS = '>=4.2.4 <5.1.0'; +const SUPPORTED_TYPESCRIPT_VERSIONS = '>=4.3.5 <5.1.0'; /* * The semver package will ignore prerelease ranges, and we don't want to explicitly document every one * List them all separately here, so we can automatically create the full string */ -const SUPPORTED_PRERELEASE_RANGES: string[] = ['5.0.1-rc']; +const SUPPORTED_PRERELEASE_RANGES: string[] = []; const ACTIVE_TYPESCRIPT_VERSION = ts.version; const isRunningSupportedTypeScriptVersion = semver.satisfies( ACTIVE_TYPESCRIPT_VERSION, diff --git a/packages/typescript-estree/src/version-check.ts b/packages/typescript-estree/src/version-check.ts index 4cf96139a74a..b4bc633753f3 100644 --- a/packages/typescript-estree/src/version-check.ts +++ b/packages/typescript-estree/src/version-check.ts @@ -12,7 +12,6 @@ function semverCheck(version: string): boolean { } const versions = [ - '4.2', '4.3', '4.4', '4.5', diff --git a/packages/utils/package.json b/packages/utils/package.json index 52dcb601a311..c6a6cf377d19 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -4,7 +4,7 @@ "description": "Utilities for working with TypeScript + ESLint together", "files": [ "dist", - "_ts4.2", + "_ts4.3", "package.json", "README.md", "LICENSE" @@ -56,16 +56,16 @@ ], "scripts": { "build": "tsc -b tsconfig.build.json", - "postbuild": "downlevel-dts dist _ts4.2/dist --to=4.2", + "postbuild": "downlevel-dts dist _ts4.3/dist --to=4.3", "clean": "tsc -b tsconfig.build.json --clean", - "postclean": "rimraf dist && rimraf _ts3.4 && rimraf _ts4.2 && rimraf coverage", + "postclean": "rimraf dist && rimraf _ts3.4 && rimraf _ts4.3 && rimraf coverage", "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", "lint": "nx lint", "test": "jest --coverage", "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/eslint-utils": "^4.3.0", "@types/json-schema": "^7.0.9", "@types/semver": "^7.3.12", "@typescript-eslint/scope-manager": "5.58.0", @@ -88,7 +88,7 @@ "typesVersions": { "<4.7": { "*": [ - "_ts4.2/*" + "_ts4.3/*" ] } } diff --git a/packages/visitor-keys/package.json b/packages/visitor-keys/package.json index 86209781afc4..d2ac3650e368 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -4,7 +4,7 @@ "description": "Visitor keys used to help traverse the TypeScript-ESTree AST", "files": [ "dist", - "_ts4.2", + "_ts4.3", "package.json", "README.md", "LICENSE" @@ -36,9 +36,9 @@ ], "scripts": { "build": "tsc -b tsconfig.build.json", - "postbuild": "downlevel-dts dist _ts4.2/dist --to=4.2", + "postbuild": "downlevel-dts dist _ts4.3/dist --to=4.3", "clean": "tsc -b tsconfig.build.json --clean", - "postclean": "rimraf dist && rimraf _ts3.4 && rimraf _ts4.2 && rimraf coverage", + "postclean": "rimraf dist && rimraf _ts3.4 && rimraf _ts4.3 && rimraf coverage", "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", "lint": "nx lint", "test": "jest --coverage", @@ -58,7 +58,7 @@ "typesVersions": { "<4.7": { "*": [ - "_ts4.2/*" + "_ts4.3/*" ] } } diff --git a/packages/website/blog/2023-03-13-announcing-typescript-eslint-v6-beta.md b/packages/website/blog/2023-03-13-announcing-typescript-eslint-v6-beta.md index c2ef412cace3..df9d101c5165 100644 --- a/packages/website/blog/2023-03-13-announcing-typescript-eslint-v6-beta.md +++ b/packages/website/blog/2023-03-13-announcing-typescript-eslint-v6-beta.md @@ -162,7 +162,7 @@ Several rules were changed in significant enough ways to be considered breaking - [feat(typescript-estree): deprecate createDefaultProgram](https://github.com/typescript-eslint/typescript-eslint/pull/5890): Renames `createDefaultProgram` to `deprecated__createDefaultProgram`, with associated `@deprecated` TSDoc tags and warnings. - [feat: drop support for node v12](https://github.com/typescript-eslint/typescript-eslint/pull/5918) -- [feat: bump minimum supported TS version to 4.2.4](https://github.com/typescript-eslint/typescript-eslint/pull/5915): this matches [DefinitelyTyped's 2-year support window](https://github.com/DefinitelyTyped/DefinitelyTyped#support-window). +- [feat: bump minimum supported TS version to 4.3.5](https://github.com/typescript-eslint/typescript-eslint/issues/6923): this matches [DefinitelyTyped's 2-year support window](https://github.com/DefinitelyTyped/DefinitelyTyped#support-window). - [chore: drop support for ESLint v6](https://github.com/typescript-eslint/typescript-eslint/pull/5972) - [feat(eslint-plugin): [prefer-readonly-parameter-types] added an optional type allowlist](https://github.com/typescript-eslint/typescript-eslint/pull/4436): changes the public `isTypeReadonlyArrayOrTuple` function's first argument from a `checker: ts.TypeChecker` to a full `program: ts.Program` diff --git a/packages/website/src/components/editor/useSandboxServices.ts b/packages/website/src/components/editor/useSandboxServices.ts index 027e12d918cf..86cb92bdc199 100644 --- a/packages/website/src/components/editor/useSandboxServices.ts +++ b/packages/website/src/components/editor/useSandboxServices.ts @@ -93,7 +93,7 @@ export const useSandboxServices = ( Array.from( new Set([...sandboxInstance.supportedVersions, window.ts.version]), ) - .filter(item => parseFloat(item) >= 4.2) + .filter(item => parseFloat(item) >= 4.3) .sort((a, b) => b.localeCompare(a)), ); diff --git a/yarn.lock b/yarn.lock index f5abd8194ce7..b30fdbd4be7e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5478,12 +5478,7 @@ color-support@^1.1.3: resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2" integrity sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg== -colord@^2.9.1: - version "2.9.1" - resolved "https://registry.yarnpkg.com/colord/-/colord-2.9.1.tgz#c961ea0efeb57c9f0f4834458f26cb9cc4a3f90e" - integrity sha512-4LBMSt09vR0uLnPVkOUBnmxgoaeN4ewRbx801wY/bXcltXfpR/G46OdWn96XpYmCWuYvO46aBZP4NgX8HpNAcw== - -colord@^2.9.3: +colord@^2.9.1, colord@^2.9.3: version "2.9.3" resolved "https://registry.yarnpkg.com/colord/-/colord-2.9.3.tgz#4f8ce919de456f1d5c1c368c307fe20f3e59fb43" integrity sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw== @@ -7030,7 +7025,7 @@ eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.0.tgz#c7f0f956124ce677047ddbc192a68f999454dedc" integrity sha512-HPpKPUBQcAsZOsHAFwTtIKcYlCje62XB7SEAcxjtmW6TD1WVpkS6i6/hOVtTZIl4zGj/mBqpFVGvaDneik+VoQ== -eslint@*: +eslint@*, eslint@^8.34.0: version "8.38.0" resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.38.0.tgz#a62c6f36e548a5574dd35728ac3c6209bd1e2f1a" integrity sha512-pIdsD2jwlUGf/U38Jv97t8lq6HpaU/G9NKbYmpWpZGw3LdTNhZLbJePqxOXGB5+JEKfOPU/XLxYxFh03nr1KTg== @@ -7076,52 +7071,6 @@ eslint@*: strip-json-comments "^3.1.0" text-table "^0.2.0" -eslint@^8.34.0: - version "8.36.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.36.0.tgz#1bd72202200a5492f91803b113fb8a83b11285cf" - integrity sha512-Y956lmS7vDqomxlaaQAHVmeb4tNMp2FWIvU/RnU5BD3IKMD/MJPr76xdyr68P8tV1iNMvN2mRK0yy3c+UjL+bw== - dependencies: - "@eslint-community/eslint-utils" "^4.2.0" - "@eslint-community/regexpp" "^4.4.0" - "@eslint/eslintrc" "^2.0.1" - "@eslint/js" "8.36.0" - "@humanwhocodes/config-array" "^0.11.8" - "@humanwhocodes/module-importer" "^1.0.1" - "@nodelib/fs.walk" "^1.2.8" - ajv "^6.10.0" - chalk "^4.0.0" - cross-spawn "^7.0.2" - debug "^4.3.2" - doctrine "^3.0.0" - escape-string-regexp "^4.0.0" - eslint-scope "^7.1.1" - eslint-visitor-keys "^3.3.0" - espree "^9.5.0" - esquery "^1.4.2" - esutils "^2.0.2" - fast-deep-equal "^3.1.3" - file-entry-cache "^6.0.1" - find-up "^5.0.0" - glob-parent "^6.0.2" - globals "^13.19.0" - grapheme-splitter "^1.0.4" - ignore "^5.2.0" - import-fresh "^3.0.0" - imurmurhash "^0.1.4" - is-glob "^4.0.0" - is-path-inside "^3.0.3" - js-sdsl "^4.1.4" - js-yaml "^4.1.0" - json-stable-stringify-without-jsonify "^1.0.1" - levn "^0.4.1" - lodash.merge "^4.6.2" - minimatch "^3.1.2" - natural-compare "^1.4.0" - optionator "^0.9.1" - strip-ansi "^6.0.1" - strip-json-comments "^3.1.0" - text-table "^0.2.0" - espree@^9.5.0, espree@^9.5.1: version "9.5.1" resolved "https://registry.yarnpkg.com/espree/-/espree-9.5.1.tgz#4f26a4d5f18905bf4f2e0bd99002aab807e96dd4" @@ -12099,16 +12048,7 @@ postcss-zindex@^5.1.0: resolved "https://registry.yarnpkg.com/postcss-zindex/-/postcss-zindex-5.1.0.tgz#4a5c7e5ff1050bd4c01d95b1847dfdcc58a496ff" integrity sha512-fgFMf0OtVSBR1va1JNHYgMxYk73yhn/qb4uQDq1DLGYolz8gHCyr/sesEuGUaYs58E3ZJRcpoGuPVoB7Meiq9A== -postcss@^8.3.11, postcss@^8.4.13, postcss@^8.4.14, postcss@^8.4.7: - version "8.4.14" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.14.tgz#ee9274d5622b4858c1007a74d76e42e56fd21caf" - integrity sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig== - dependencies: - nanoid "^3.3.4" - picocolors "^1.0.0" - source-map-js "^1.0.2" - -postcss@^8.4.21: +postcss@^8.3.11, postcss@^8.4.13, postcss@^8.4.14, postcss@^8.4.21, postcss@^8.4.7: version "8.4.21" resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.21.tgz#c639b719a57efc3187b13a1d765675485f4134f4" integrity sha512-tP7u/Sn/dVxK2NnruI4H9BG+x+Wxz6oeZ1cJ8P6G/PZY0IKk4k/63TDsQf2kQq3+qoJeLm2kIBUNlZe3zgb4Zg== @@ -14453,7 +14393,7 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@*, "typescript@>=4.2.4 <5.1.0", "typescript@^3 || ^4", typescript@next, typescript@~4.8.4, typescript@~5.0.2: +typescript@*, "typescript@>=4.3.5 <5.1.0", "typescript@^3 || ^4", typescript@next, typescript@~4.8.4, typescript@~5.0.4: version "5.0.4" resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.4.tgz#b217fd20119bd61a94d4011274e0ab369058da3b" integrity sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==