Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Commit

Permalink
fix: add support for TypeScript 4.0
Browse files Browse the repository at this point in the history
Closes #4941
  • Loading branch information
alan-agius4 committed Jul 23, 2020
1 parent 19fdb01 commit 727286e
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 11 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@
"mkdirp": "^0.5.3",
"resolve": "^1.3.2",
"semver": "^5.3.0",
"tslib": "^1.10.0",
"tslib": "^2.0.0",
"tsutils": "^2.29.0"
},
"peerDependencies": {
"typescript": ">=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >=3.0.0-dev || >= 3.1.0-dev || >= 3.2.0-dev"
"typescript": ">=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >=3.0.0-dev || >= 3.1.0-dev || >= 3.2.0-dev || >= 4.0.0-dev"
},
"devDependencies": {
"@octokit/rest": "^16.24.3",
Expand Down Expand Up @@ -73,7 +73,7 @@
"tslint-config-prettier": "^1.18.0",
"tslint-plugin-prettier": "^2.0.1",
"tslint-test-config-non-relative": "file:test/external/tslint-test-config-non-relative",
"typescript": "~3.8.2",
"typescript": "~4.0.0-dev.20200722",
"yarn-deduplicate": "^1.1.1"
},
"engines": {
Expand Down
4 changes: 3 additions & 1 deletion src/rules/alignRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ class AlignWalker extends Lint.AbstractWalker<Options> {
case ts.SyntaxKind.TupleType:
if (this.options.elements) {
this.checkAlignment(
(node as ts.TupleTypeNode).elementTypes,
// In TS 4 TupleTypeNode.elementTypes has been updated to elements
// tslint:disable-next-line
(node as any).elementTypes || (node as ts.TupleTypeNode).elements,
OPTION_ELEMENTS,
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/rules/noRedundantJsdocRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function walk(ctx: Lint.WalkContext): void {
);
}
break;

case ts.SyntaxKind.JSDocDeprecatedTag:
case ts.SyntaxKind.JSDocAugmentsTag:
case ts.SyntaxKind.JSDocAuthorTag:
// OK
Expand Down
2 changes: 1 addition & 1 deletion src/rules/oneLineRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class OneLineWalker extends Lint.AbstractWalker<Options> {
if (
!isBlockLike(node.parent) ||
(node.parent.kind === ts.SyntaxKind.CaseClause &&
(node.parent as ts.CaseClause).statements.length === 1)
node.parent.statements.length === 1)
) {
this.check({ pos: node.pos, end: (node as ts.Block).statements.pos });
}
Expand Down
15 changes: 10 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1822,11 +1822,16 @@ tsconfig@^6.0.0:
strip-bom "^3.0.0"
strip-json-comments "^2.0.0"

tslib@^1.10.0, tslib@^1.7.1, tslib@^1.8.0, tslib@^1.8.1:
tslib@^1.7.1, tslib@^1.8.0, tslib@^1.8.1:
version "1.10.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a"
integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==

tslib@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.0.0.tgz#18d13fc2dce04051e20f074cc8387fd8089ce4f3"
integrity sha512-lTqkx847PI7xEDYJntxZH89L2/aXInsyF2luSafe/+0fHOMjlBNXdH6th7f70qxLDhul7KZK0zC8V5ZIyHl0/g==

tslint-config-prettier@^1.18.0:
version "1.18.0"
resolved "https://registry.yarnpkg.com/tslint-config-prettier/-/tslint-config-prettier-1.18.0.tgz#75f140bde947d35d8f0d238e0ebf809d64592c37"
Expand Down Expand Up @@ -1880,10 +1885,10 @@ type-detect@^1.0.0:
resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-1.0.0.tgz#762217cc06db258ec48908a1298e8b95121e8ea2"
integrity sha1-diIXzAbbJY7EiQihKY6LlRIejqI=

typescript@~3.8.2:
version "3.8.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.8.2.tgz#91d6868aaead7da74f493c553aeff76c0c0b1d5a"
integrity sha512-EgOVgL/4xfVrCMbhYKUQTdF37SQn4Iw73H5BgCrF1Abdun7Kwy/QZsE/ssAy0y4LxBbvua3PIbFsbRczWWnDdQ==
typescript@~4.0.0-dev.20200722:
version "4.0.0-dev.20200722"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.0.0-dev.20200722.tgz#b59dd5a3cd84a98d5aae0e4f3a3c58f0c81a3b9b"
integrity sha512-MmJ1YyPNK3JYeKLiTg5sQXdeZaMgt99Fg4BMRZhJmhoq1/x2V1cpXMYvE1rtIYl9K7NvmTDdU3WDW7ZOD6ybaw==

uglify-js@^3.1.4:
version "3.5.11"
Expand Down

0 comments on commit 727286e

Please sign in to comment.