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

Add await-promise rule #2102

Merged
merged 1 commit into from Jan 23, 2017
Merged

Add await-promise rule #2102

merged 1 commit into from Jan 23, 2017

Conversation

andy-hanson
Copy link
Contributor

PR checklist

  • Addresses an existing issue: #0000
  • New feature, bugfix, or enhancement
    • Includes tests
  • Documentation update

What changes did you make?

Added the await-Promise rule, which ensures that anything in an await expression could actually be a Promise. Prevents needlessly awaiting synchronously available values.

This is complementary to #1632: That ensures that Promises are awaited, while this ensures that awaiteds are Promises.

@adidahiya adidahiya changed the title Add await-promise rule. Add await-promise rule Jan 23, 2017
Copy link
Contributor

@nchen63 nchen63 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, thanks!

@nchen63 nchen63 merged commit 7751f99 into palantir:master Jan 23, 2017
export class Rule extends Lint.Rules.TypedRule {
/* tslint:disable:object-literal-sort-keys */
public static metadata: Lint.IRuleMetadata = {
ruleName: "strict-boolean-expressions",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like wrong ruleName. Should be await-promise instead of strict-boolean-expressions.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

Can we have a script that uses a template for creating a rule please?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants