diff options
author | Fabio Berger <me@fabioberger.com> | 2018-01-30 20:26:46 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-01-30 20:26:46 +0800 |
commit | c6dece6bd1e5f5afa56b290557eb7a6245c76cb6 (patch) | |
tree | ad7a33ffe5d80c0eb41ae10fbc8314f193e52383 /packages/tslint-config/rules/walkers/async_suffix.ts | |
parent | 93a5b3f457c1211676296840c285759007a55500 (diff) | |
download | dexon-0x-contracts-c6dece6bd1e5f5afa56b290557eb7a6245c76cb6.tar.gz dexon-0x-contracts-c6dece6bd1e5f5afa56b290557eb7a6245c76cb6.tar.zst dexon-0x-contracts-c6dece6bd1e5f5afa56b290557eb7a6245c76cb6.zip |
Add config file specifically in prettier command and fix files
Diffstat (limited to 'packages/tslint-config/rules/walkers/async_suffix.ts')
-rw-r--r-- | packages/tslint-config/rules/walkers/async_suffix.ts | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/packages/tslint-config/rules/walkers/async_suffix.ts b/packages/tslint-config/rules/walkers/async_suffix.ts index e1138de8d..eaec9c5f6 100644 --- a/packages/tslint-config/rules/walkers/async_suffix.ts +++ b/packages/tslint-config/rules/walkers/async_suffix.ts @@ -3,24 +3,24 @@ import * as Lint from 'tslint'; import * as ts from 'typescript'; export class AsyncSuffixWalker extends Lint.RuleWalker { - public static FAILURE_STRING = 'async functions must have an Async suffix'; - public visitMethodDeclaration(node: ts.MethodDeclaration): void { - const methodNameNode = node.name; - const methodName = methodNameNode.getText(); - if (!_.isUndefined(node.type)) { - if (node.type.kind === ts.SyntaxKind.TypeReference) { - // tslint:disable-next-line:no-unnecessary-type-assertion - const returnTypeName = (node.type as ts.TypeReferenceNode).typeName.getText(); - if (returnTypeName === 'Promise' && !methodName.endsWith('Async')) { - const failure = this.createFailure( - methodNameNode.getStart(), - methodNameNode.getWidth(), - AsyncSuffixWalker.FAILURE_STRING, - ); - this.addFailure(failure); - } - } - } - super.visitMethodDeclaration(node); - } + public static FAILURE_STRING = 'async functions must have an Async suffix'; + public visitMethodDeclaration(node: ts.MethodDeclaration): void { + const methodNameNode = node.name; + const methodName = methodNameNode.getText(); + if (!_.isUndefined(node.type)) { + if (node.type.kind === ts.SyntaxKind.TypeReference) { + // tslint:disable-next-line:no-unnecessary-type-assertion + const returnTypeName = (node.type as ts.TypeReferenceNode).typeName.getText(); + if (returnTypeName === 'Promise' && !methodName.endsWith('Async')) { + const failure = this.createFailure( + methodNameNode.getStart(), + methodNameNode.getWidth(), + AsyncSuffixWalker.FAILURE_STRING, + ); + this.addFailure(failure); + } + } + } + super.visitMethodDeclaration(node); + } } |