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

Add new Rule: arrow-parens #1384

Merged
merged 3 commits into from
Jul 20, 2016
Merged

Conversation

YuichiNukiyama
Copy link
Contributor

@YuichiNukiyama YuichiNukiyama commented Jul 8, 2016

Impliment #777
Arrow function allow ommit parentheses when parameter is single. This PR enforces parentheses around typeless parameter of arrow function .
This PR doent't warn typed parameter. Becase, TS don't allow ommit parentheses when we use typed parameter. following code, TS warn syntax error and TSLint don't

var a = b:number => {};

/* tslint:disable:object-literal-sort-keys */
public static metadata: Lint.IRuleMetadata = {
ruleName: "arrow-parens",
description: "Requires parentheses when using arrow function.",
Copy link
Contributor

@jkillian jkillian Jul 20, 2016

Choose a reason for hiding this comment

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

Can we change this to: "Requires parentheses around the parameters of arrow function definitions."

@jkillian
Copy link
Contributor

Looks good @YuichiNukiyama! Mind making the small documentation tweaks mentioned above?

@YuichiNukiyama
Copy link
Contributor Author

Thanks @jkillian. I did it.

@jkillian
Copy link
Contributor

Thanks @YuichiNukiyama!

@jkillian jkillian merged commit 81c538c into palantir:master Jul 20, 2016
@YuichiNukiyama YuichiNukiyama deleted the arrowparens branch July 20, 2016 21:17
soniro pushed a commit to soniro/tslint that referenced this pull request Aug 31, 2016
* Add new Rule: arrow-parens

* Add test

* modify some documentations
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