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

Commit

Permalink
fixup! Upgrade to TypeScript 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
rrdelaney committed Feb 28, 2020
1 parent 1b4cae0 commit e0d4509
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions src/language/utils.ts
Expand Up @@ -582,3 +582,9 @@ export function isWhiteSpace(ch: number): boolean {
// tslint:disable-next-line
return (ts.isWhiteSpaceLike || (ts as any).isWhiteSpace)(ch);
}

/** Wrapper for compatability with typescript@<3.8.2 */
export function isPrivateIdentifier(node: ts.Node): node is ts.PrivateIdentifier {
// tslint:disable-next-line
return ts.isPrivateIdentifier ? ts.isPrivateIdentifier(node) : false;
}
3 changes: 2 additions & 1 deletion src/rules/importBlacklistRule.ts
Expand Up @@ -20,6 +20,7 @@ import {
ImportKind,
isExportDeclaration,
isImportDeclaration,
isNamedExports,
isNamedImports,
} from "tsutils";
import * as ts from "typescript";
Expand Down Expand Up @@ -237,7 +238,7 @@ function walk(ctx: Lint.WalkContext<Options>) {
toExportName,
)
: []),
...(exportClause && ts.isNamedExports(exportClause)
...(exportClause !== undefined && isNamedExports(exportClause)
? exportClause.elements.map(toExportName)
: []),
];
Expand Down
2 changes: 1 addition & 1 deletion src/rules/noUnnecessaryQualifierRule.ts
Expand Up @@ -64,7 +64,7 @@ function walk(ctx: Lint.WalkContext, checker: ts.TypeChecker): void {

case ts.SyntaxKind.PropertyAccessExpression:
const { expression, name } = node as ts.PropertyAccessExpression;
if (utils.isEntityNameExpression(expression) && !ts.isPrivateIdentifier(name)) {
if (utils.isEntityNameExpression(expression) && !Lint.isPrivateIdentifier(name)) {
visitNamespaceAccess(node, expression, name);
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/rules/whitespaceRule.ts
Expand Up @@ -175,7 +175,7 @@ function walk(ctx: Lint.WalkContext<Options>) {
if (
options.module &&
exportClause !== undefined &&
ts.isNamedExports(exportClause)
utils.isNamedExports(exportClause)
) {
exportClause.elements.forEach((element, idx, arr) => {
if (idx === arr.length - 1) {
Expand Down

0 comments on commit e0d4509

Please sign in to comment.