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

[Rule request] Flag unnecessary parenthesis #3567

Closed
JoshuaKGoldberg opened this issue Dec 11, 2017 · 2 comments
Closed

[Rule request] Flag unnecessary parenthesis #3567

JoshuaKGoldberg opened this issue Dec 11, 2017 · 2 comments

Comments

@JoshuaKGoldberg
Copy link
Contributor

const isParameterDecorator = (typeof parameterIndex === "number");

Perhaps a rule to complain about the parenthesis? To me, it looks like the writer might not have understood that they're unnecessary in those situations.

It should probably ignore expressions across lines, since some folks prefer parenthesis to make multiline expressions more clear.

@JoshuaKGoldberg JoshuaKGoldberg changed the title [Rule request] Flag unnecessary parenthesis in [Rule request] Flag unnecessary parenthesis Dec 11, 2017
@ajafff
Copy link
Contributor

ajafff commented Dec 11, 2017

#3238 tried to add a configurable rule for that use case. It was rejected, because the configuration was not really understandable for someone not familiar with typescript internals.
Banning all unnecessary parens on the other hand is a bit too much.

@adidahiya
Copy link
Contributor

I think this falls under the category of formatting rules I mentioned in #3592. As such, I don't think we should invest effort in it in core TSLint rules.

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

No branches or pull requests

3 participants