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

Feature Request: Don't require semi-colons after bound-method declarations. #1076

Closed
AndyMoreland opened this issue Apr 1, 2016 · 2 comments

Comments

@AndyMoreland
Copy link
Contributor

TypeScript code being linted

private handleFoo = (newState: boolean) => {
    this.setState({ banana: newState });
}

Actual behavior

When I have the "semicolon" rule on, tslint complains of a missing semi-colon after the closing } in this method definition.

Expected behavior

I want a way to make the semi-colon after the closing } optional. I view this construct as a way of defining a /method/, not a /property/, and methods don't close with ;.

@adidahiya
Copy link
Contributor

We could change the semicolon rule to start being lenient here, or add a new allow-member-functions option to enable leniency. My slight preference is for the former. Thoughts @jkillian?

@AndyMoreland
Copy link
Contributor Author

I've pushed a PR that addresses this, I think. If the semi-colon rule is set to "enabled", it'll be lenient. When it's "always", it'll require them.

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

2 participants