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 (#4943)
Browse files Browse the repository at this point in the history
Closes #4941
  • Loading branch information
alan-agius4 authored Jul 30, 2020
1 parent 19fdb01 commit 0efa8ec
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 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": "^1.13.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-beta",
"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
16 changes: 8 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1822,10 +1822,10 @@ 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:
version "1.10.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a"
integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==
tslib@^1.13.0, tslib@^1.7.1, tslib@^1.8.0, tslib@^1.8.1:
version "1.13.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.13.0.tgz#c881e13cc7015894ed914862d276436fa9a47043"
integrity sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==

tslint-config-prettier@^1.18.0:
version "1.18.0"
Expand Down Expand Up @@ -1880,10 +1880,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-beta:
version "4.0.0-dev.20200730"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.0.0-dev.20200730.tgz#0c1e874cbbfc702c32d9ac261c2f9dc9c37b14c1"
integrity sha512-bqw862eRy5niIZgCJTmn9DqkHTPoCF2eLlLA6jmOvubOgN8BNQrsaf+fE4PQkhzk9ae1/T9iAmDhapgmwWMHIA==

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

0 comments on commit 0efa8ec

Please sign in to comment.