Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7925823

Browse files
authored
fix(experimental-utils): downlevel type declarations for versions older than 3.8 (typescript-eslint#2133)
1 parent 8a0fd18 commit 7925823

File tree

10 files changed

+64
-5
lines changed

10 files changed

+64
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,6 @@ jspm_packages/
6464
.DS_Store
6565
.idea
6666
dist
67+
_ts3.4
6768
*.tsbuildinfo
6869
.watchmanconfig

package.json

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,18 @@
4949
"extends": [
5050
"@commitlint/config-conventional",
5151
"@commitlint/config-lerna-scopes"
52-
]
52+
],
53+
"rules": {
54+
"body-max-length": [
55+
0
56+
],
57+
"footer-max-length": [
58+
0
59+
],
60+
"header-max-length": [
61+
0
62+
]
63+
}
5364
},
5465
"engines": {
5566
"node": "^10.12.0 || >=12.0.0"
@@ -64,6 +75,7 @@
6475
"all-contributors-cli": "^6.14.2",
6576
"cspell": "^4.0.61",
6677
"cz-conventional-changelog": "^3.2.0",
78+
"downlevel-dts": "^0.4.0",
6779
"eslint": "^7.0.0",
6880
"eslint-plugin-eslint-comments": "^3.1.2",
6981
"eslint-plugin-eslint-plugin": "^2.2.1",
@@ -76,6 +88,7 @@
7688
"lint-staged": "^10.2.2",
7789
"markdownlint-cli": "^0.23.0",
7890
"prettier": "^2.0.5",
91+
"rimraf": "^3.0.2",
7992
"ts-jest": "^25.5.1",
8093
"ts-node": "^8.10.1",
8194
"tslint": "^6.1.2",

packages/eslint-plugin-internal/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"scripts": {
77
"build": "tsc -b tsconfig.build.json",
88
"clean": "tsc -b tsconfig.build.json --clean",
9+
"postclean": "rimraf dist",
910
"format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore",
1011
"lint": "eslint . --ext .js,.ts --ignore-path='../../.eslintignore'",
1112
"test": "jest --coverage",

packages/eslint-plugin-tslint/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"scripts": {
2626
"build": "tsc -b tsconfig.build.json",
2727
"clean": "tsc -b tsconfig.build.json --clean",
28+
"postclean": "rimraf dist",
2829
"format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore",
2930
"lint": "eslint . --ext .js,.ts --ignore-path='../../.eslintignore'",
3031
"test": "jest --coverage",

packages/eslint-plugin/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"check:docs": "jest tests/docs.test.ts --runTestsByPath --silent --runInBand",
3434
"check:configs": "jest tests/configs.test.ts --runTestsByPath --silent --runInBand",
3535
"clean": "tsc -b tsconfig.build.json --clean",
36+
"postclean": "rimraf dist",
3637
"format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore",
3738
"generate:configs": "../../node_modules/.bin/ts-node --files --transpile-only tools/generate-configs.ts",
3839
"generate:rules-lists": "../../node_modules/.bin/ts-node --files --transpile-only tools/generate-rules-lists.ts",

packages/experimental-utils/package.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
},
1313
"files": [
1414
"dist",
15+
"_ts3.4",
1516
"package.json",
1617
"README.md",
1718
"LICENSE"
@@ -29,7 +30,9 @@
2930
"types": "dist/index.d.ts",
3031
"scripts": {
3132
"build": "tsc -b tsconfig.build.json",
33+
"postbuild": "downlevel-dts dist _ts3.4/dist",
3234
"clean": "tsc -b tsconfig.build.json --clean",
35+
"postclean": "rimraf dist && rimraf _ts3.4",
3336
"format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore",
3437
"lint": "eslint . --ext .js,.ts --ignore-path='../../.eslintignore'",
3538
"test": "jest --coverage",
@@ -50,5 +53,12 @@
5053
"funding": {
5154
"type": "opencollective",
5255
"url": "https://opencollective.com/typescript-eslint"
56+
},
57+
"typesVersions": {
58+
"<3.8": {
59+
"*": [
60+
"ts3.4/*"
61+
]
62+
}
5363
}
5464
}

packages/parser/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"scripts": {
3434
"build": "tsc -b tsconfig.build.json",
3535
"clean": "tsc -b tsconfig.build.json --clean",
36+
"postclean": "rimraf dist",
3637
"format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore",
3738
"lint": "eslint . --ext .js,.ts --ignore-path='../../.eslintignore'",
3839
"test": "jest --coverage",

packages/shared-fixtures/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"scripts": {
66
"build": "tsc -b tsconfig.build.json",
77
"clean": "tsc -b tsconfig.build.json --clean",
8+
"postclean": "rimraf dist",
89
"typecheck": "tsc -p tsconfig.json --noEmit"
910
}
1011
}

packages/typescript-estree/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"scripts": {
3434
"build": "tsc -b tsconfig.build.json",
3535
"clean": "tsc -b tsconfig.build.json --clean",
36+
"postclean": "rimraf dist",
3637
"format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore",
3738
"lint": "eslint . --ext .js,.ts --ignore-path='../../.eslintignore'",
3839
"test": "jest --coverage",

yarn.lock

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3403,6 +3403,14 @@ dot-prop@^5.2.0:
34033403
dependencies:
34043404
is-obj "^2.0.0"
34053405

3406+
downlevel-dts@^0.4.0:
3407+
version "0.4.0"
3408+
resolved "https://registry.yarnpkg.com/downlevel-dts/-/downlevel-dts-0.4.0.tgz#43f9f649c8b137373d76b4ee396d5a0227c10ddb"
3409+
integrity sha512-nh5vM3n2pRhPwZqh0iWo5gpItPAYEGEWw9yd0YpI+lO60B7A3A6iJlxDbt7kKVNbqBXKsptL+jwE/Yg5Go66WQ==
3410+
dependencies:
3411+
shelljs "^0.8.3"
3412+
typescript "^3.8.0-dev.20200111"
3413+
34063414
duplexer@^0.1.1:
34073415
version "0.1.1"
34083416
resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1"
@@ -4267,7 +4275,7 @@ glob-to-regexp@^0.3.0:
42674275
resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz#8c5a1494d2066c570cc3bfe4496175acc4d502ab"
42684276
integrity sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=
42694277

4270-
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:
4278+
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:
42714279
version "7.1.6"
42724280
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6"
42734281
integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==
@@ -4713,6 +4721,11 @@ inquirer@^7.0.0, inquirer@^7.0.4:
47134721
strip-ansi "^6.0.0"
47144722
through "^2.3.6"
47154723

4724+
interpret@^1.0.0:
4725+
version "1.2.0"
4726+
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.2.0.tgz#d5061a6224be58e8083985f5014d844359576296"
4727+
integrity sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw==
4728+
47164729
ip-regex@^2.1.0:
47174730
version "2.1.0"
47184731
resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9"
@@ -7285,6 +7298,13 @@ realpath-native@^2.0.0:
72857298
resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-2.0.0.tgz#7377ac429b6e1fd599dc38d08ed942d0d7beb866"
72867299
integrity sha512-v1SEYUOXXdbBZK8ZuNgO4TBjamPsiSgcFr0aP+tEKpQZK8vooEUqV6nm6Cv502mX4NF2EfsnVqtNAHG+/6Ur1Q==
72877300

7301+
rechoir@^0.6.2:
7302+
version "0.6.2"
7303+
resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384"
7304+
integrity sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=
7305+
dependencies:
7306+
resolve "^1.1.6"
7307+
72887308
redent@^1.0.0:
72897309
version "1.0.0"
72907310
resolved "https://registry.yarnpkg.com/redent/-/redent-1.0.0.tgz#cf916ab1fd5f1f16dfb20822dd6ec7f730c2afde"
@@ -7472,7 +7492,7 @@ [email protected]:
74727492
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b"
74737493
integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=
74747494

7475-
resolve@^1.10.0, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.17.0, resolve@^1.3.2:
7495+
resolve@^1.1.6, resolve@^1.10.0, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.17.0, resolve@^1.3.2:
74767496
version "1.17.0"
74777497
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444"
74787498
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:
75197539
dependencies:
75207540
glob "^7.1.3"
75217541

7522-
rimraf@^3.0.0:
7542+
rimraf@^3.0.0, rimraf@^3.0.2:
75237543
version "3.0.2"
75247544
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a"
75257545
integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==
@@ -7665,6 +7685,15 @@ shebang-regex@^3.0.0:
76657685
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172"
76667686
integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==
76677687

7688+
shelljs@^0.8.3:
7689+
version "0.8.4"
7690+
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.4.tgz#de7684feeb767f8716b326078a8a00875890e3c2"
7691+
integrity sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==
7692+
dependencies:
7693+
glob "^7.0.0"
7694+
interpret "^1.0.0"
7695+
rechoir "^0.6.2"
7696+
76687697
shellwords@^0.1.1:
76697698
version "0.1.1"
76707699
resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b"
@@ -8493,7 +8522,7 @@ typedarray@^0.0.6:
84938522
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
84948523
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
84958524

8496-
typescript@*, [email protected], "typescript@>=3.3.1 <4.0.0":
8525+
typescript@*, [email protected], "typescript@>=3.3.1 <4.0.0", typescript@^3.8.0-dev.20200111:
84978526
version "3.9.2"
84988527
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.2.tgz#64e9c8e9be6ea583c54607677dd4680a1cf35db9"
84998528
integrity sha512-q2ktq4n/uLuNNShyayit+DTobV2ApPEo/6so68JaD5ojvc/6GClBipedB9zNWYxRSAlZXAe405Rlijzl6qDiSw==

0 commit comments

Comments
 (0)