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

typedef-whitespace: Extract getOptionType helper #2807

Merged
merged 1 commit into from
May 26, 2017

Conversation

andy-hanson
Copy link
Contributor

PR checklist

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

Overview of change:

Just noticed that this switch always calls checkSpace on the same node, so extracted out a function that just gets the option type.

}
return ts.forEachChild(node, cb);
};
return ts.forEachChild(sourceFile, cb);
}

private checkSpace(node: ts.FunctionLikeDeclaration | ts.SignatureDeclaration | ts.VariableLikeDeclaration, key: OptionType) {
private checkSpace(node: ts.SignatureDeclaration | ts.VariableLikeDeclaration, key: OptionType) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

FunctionLikeDeclaration subtypes SignatureDeclaration.

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.

3 participants