From 523fe0d736af3ce2e9c1e15db88f896946d68c1b Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Sat, 30 May 2020 11:03:38 -0700 Subject: [PATCH] fix(experimental-utils): downlevel type declarations for versions older than 3.8 --- .gitignore | 1 + package.json | 15 +++++++- packages/eslint-plugin-internal/package.json | 1 + packages/eslint-plugin-tslint/package.json | 1 + packages/eslint-plugin/package.json | 1 + packages/experimental-utils/package.json | 10 ++++++ packages/parser/package.json | 1 + packages/shared-fixtures/package.json | 1 + packages/typescript-estree/package.json | 1 + yarn.lock | 37 +++++++++++++++++--- 10 files changed, 64 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 582f78d2d60..b7d08022ef7 100644 --- a/.gitignore +++ b/.gitignore @@ -64,5 +64,6 @@ jspm_packages/ .DS_Store .idea dist +_ts3.4 *.tsbuildinfo .watchmanconfig diff --git a/package.json b/package.json index 6010da4c5c8..a3ffa851516 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,18 @@ "extends": [ "@commitlint/config-conventional", "@commitlint/config-lerna-scopes" - ] + ], + "rules": { + "body-max-length": [ + 0 + ], + "footer-max-length": [ + 0 + ], + "header-max-length": [ + 0 + ] + } }, "engines": { "node": "^10.12.0 || >=12.0.0" @@ -64,6 +75,7 @@ "all-contributors-cli": "^6.14.2", "cspell": "^4.0.61", "cz-conventional-changelog": "^3.2.0", + "downlevel-dts": "^0.4.0", "eslint": "^7.0.0", "eslint-plugin-eslint-comments": "^3.1.2", "eslint-plugin-eslint-plugin": "^2.2.1", @@ -76,6 +88,7 @@ "lint-staged": "^10.2.2", "markdownlint-cli": "^0.23.0", "prettier": "^2.0.5", + "rimraf": "^3.0.2", "ts-jest": "^25.5.1", "ts-node": "^8.10.1", "tslint": "^6.1.2", diff --git a/packages/eslint-plugin-internal/package.json b/packages/eslint-plugin-internal/package.json index ffe49178a51..b46649cd0d0 100644 --- a/packages/eslint-plugin-internal/package.json +++ b/packages/eslint-plugin-internal/package.json @@ -6,6 +6,7 @@ "scripts": { "build": "tsc -b tsconfig.build.json", "clean": "tsc -b tsconfig.build.json --clean", + "postclean": "rimraf dist", "format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore", "lint": "eslint . --ext .js,.ts --ignore-path='../../.eslintignore'", "test": "jest --coverage", diff --git a/packages/eslint-plugin-tslint/package.json b/packages/eslint-plugin-tslint/package.json index e42e333b8d7..6e83708d68a 100644 --- a/packages/eslint-plugin-tslint/package.json +++ b/packages/eslint-plugin-tslint/package.json @@ -25,6 +25,7 @@ "scripts": { "build": "tsc -b tsconfig.build.json", "clean": "tsc -b tsconfig.build.json --clean", + "postclean": "rimraf dist", "format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore", "lint": "eslint . --ext .js,.ts --ignore-path='../../.eslintignore'", "test": "jest --coverage", diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index ad4edb40181..644b126dbd6 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -33,6 +33,7 @@ "check:docs": "jest tests/docs.test.ts --runTestsByPath --silent --runInBand", "check:configs": "jest tests/configs.test.ts --runTestsByPath --silent --runInBand", "clean": "tsc -b tsconfig.build.json --clean", + "postclean": "rimraf dist", "format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore", "generate:configs": "../../node_modules/.bin/ts-node --files --transpile-only tools/generate-configs.ts", "generate:rules-lists": "../../node_modules/.bin/ts-node --files --transpile-only tools/generate-rules-lists.ts", diff --git a/packages/experimental-utils/package.json b/packages/experimental-utils/package.json index 485d6436520..e5c1fe1872c 100644 --- a/packages/experimental-utils/package.json +++ b/packages/experimental-utils/package.json @@ -12,6 +12,7 @@ }, "files": [ "dist", + "_ts3.4", "package.json", "README.md", "LICENSE" @@ -29,7 +30,9 @@ "types": "dist/index.d.ts", "scripts": { "build": "tsc -b tsconfig.build.json", + "postbuild": "downlevel-dts dist _ts3.4/dist", "clean": "tsc -b tsconfig.build.json --clean", + "postclean": "rimraf dist && rimraf _ts3.4", "format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore", "lint": "eslint . --ext .js,.ts --ignore-path='../../.eslintignore'", "test": "jest --coverage", @@ -50,5 +53,12 @@ "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" + }, + "typesVersions": { + "<3.8": { + "*": [ + "ts3.4/*" + ] + } } } diff --git a/packages/parser/package.json b/packages/parser/package.json index c7d8cfe67d5..6e8cef78905 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -33,6 +33,7 @@ "scripts": { "build": "tsc -b tsconfig.build.json", "clean": "tsc -b tsconfig.build.json --clean", + "postclean": "rimraf dist", "format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore", "lint": "eslint . --ext .js,.ts --ignore-path='../../.eslintignore'", "test": "jest --coverage", diff --git a/packages/shared-fixtures/package.json b/packages/shared-fixtures/package.json index 03a8bfed45f..38fc488da23 100644 --- a/packages/shared-fixtures/package.json +++ b/packages/shared-fixtures/package.json @@ -5,6 +5,7 @@ "scripts": { "build": "tsc -b tsconfig.build.json", "clean": "tsc -b tsconfig.build.json --clean", + "postclean": "rimraf dist", "typecheck": "tsc -p tsconfig.json --noEmit" } } diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index 7b9c93e1a2e..d9ea5ba2f1d 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -33,6 +33,7 @@ "scripts": { "build": "tsc -b tsconfig.build.json", "clean": "tsc -b tsconfig.build.json --clean", + "postclean": "rimraf dist", "format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore", "lint": "eslint . --ext .js,.ts --ignore-path='../../.eslintignore'", "test": "jest --coverage", diff --git a/yarn.lock b/yarn.lock index 66c94e36911..9b6fedc38d8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3403,6 +3403,14 @@ dot-prop@^5.2.0: dependencies: is-obj "^2.0.0" +downlevel-dts@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/downlevel-dts/-/downlevel-dts-0.4.0.tgz#43f9f649c8b137373d76b4ee396d5a0227c10ddb" + integrity sha512-nh5vM3n2pRhPwZqh0iWo5gpItPAYEGEWw9yd0YpI+lO60B7A3A6iJlxDbt7kKVNbqBXKsptL+jwE/Yg5Go66WQ== + dependencies: + shelljs "^0.8.3" + typescript "^3.8.0-dev.20200111" + duplexer@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1" @@ -4267,7 +4275,7 @@ glob-to-regexp@^0.3.0: resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz#8c5a1494d2066c570cc3bfe4496175acc4d502ab" integrity sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs= -glob@*, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6, glob@~7.1.2: +glob@*, glob@^7.0.0, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6, glob@~7.1.2: version "7.1.6" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== @@ -4713,6 +4721,11 @@ inquirer@^7.0.0, inquirer@^7.0.4: strip-ansi "^6.0.0" through "^2.3.6" +interpret@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.2.0.tgz#d5061a6224be58e8083985f5014d844359576296" + integrity sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw== + ip-regex@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9" @@ -7285,6 +7298,13 @@ realpath-native@^2.0.0: resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-2.0.0.tgz#7377ac429b6e1fd599dc38d08ed942d0d7beb866" integrity sha512-v1SEYUOXXdbBZK8ZuNgO4TBjamPsiSgcFr0aP+tEKpQZK8vooEUqV6nm6Cv502mX4NF2EfsnVqtNAHG+/6Ur1Q== +rechoir@^0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" + integrity sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q= + dependencies: + resolve "^1.1.6" + redent@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/redent/-/redent-1.0.0.tgz#cf916ab1fd5f1f16dfb20822dd6ec7f730c2afde" @@ -7472,7 +7492,7 @@ resolve@1.1.7: resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= -resolve@^1.10.0, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.17.0, resolve@^1.3.2: +resolve@^1.1.6, resolve@^1.10.0, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.17.0, resolve@^1.3.2: version "1.17.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== @@ -7519,7 +7539,7 @@ rimraf@^2.5.2, rimraf@^2.5.4, rimraf@^2.6.2, rimraf@^2.6.3: dependencies: glob "^7.1.3" -rimraf@^3.0.0: +rimraf@^3.0.0, rimraf@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== @@ -7665,6 +7685,15 @@ shebang-regex@^3.0.0: resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== +shelljs@^0.8.3: + version "0.8.4" + resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.4.tgz#de7684feeb767f8716b326078a8a00875890e3c2" + integrity sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ== + dependencies: + glob "^7.0.0" + interpret "^1.0.0" + rechoir "^0.6.2" + shellwords@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" @@ -8493,7 +8522,7 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@*, typescript@3.9.2, "typescript@>=3.3.1 <4.0.0": +typescript@*, typescript@3.9.2, "typescript@>=3.3.1 <4.0.0", typescript@^3.8.0-dev.20200111: version "3.9.2" resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.2.tgz#64e9c8e9be6ea583c54607677dd4680a1cf35db9" integrity sha512-q2ktq4n/uLuNNShyayit+DTobV2ApPEo/6so68JaD5ojvc/6GClBipedB9zNWYxRSAlZXAe405Rlijzl6qDiSw==