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

Make semi-colon rule laxer with bound-method properties #1081

Merged

Conversation

AndyMoreland
Copy link
Contributor

Methods declared like:

class Foo {
      bar = () => { }
}

shouldn't be marked as requiring a trailing semi-colon for the closing }

Addresses: #1076

@AndyMoreland AndyMoreland force-pushed the relax-about-bound-method-semi-colons branch from 7c52468 to a6cd301 Compare April 4, 2016 07:24
Methods declared like:

```
class Foo {
      bar = () => { }
}
```

shouldn't be marked as requiring a trailing semi-colon for the closing `}`
@AndyMoreland AndyMoreland force-pushed the relax-about-bound-method-semi-colons branch from a6cd301 to 79201cb Compare April 4, 2016 17:25
@adidahiya
Copy link
Contributor

Huh, I just now realized that the semicolon rule has three states, enabled / always / never. We should improve the docs around this, but this PR looks good to me 👍

@jkillian
Copy link
Contributor

jkillian commented Apr 7, 2016

My hesitation here: this rule currently only has two states, always & never. (if you provide neither option, it behaves as if you said always). I'm hesitant to introduce a third state to the rule without more justification, but if you guys think it's worth it, I'll listen

@adidahiya
Copy link
Contributor

Uh, yeah, after posting my comment I changed my mind because of the same hesitation. Having true and [true, "always"] behave differently could be confusing. Do ESLint or stylelint have any rule configs that work like that?

Alternatives:

  1. always be lenient about bound-method properties
  2. introduce a new option to be lenient on them, as suggested in Feature Request: Don't require semi-colons after bound-method declarations. #1076

@AndyMoreland
Copy link
Contributor Author

I didn't intentionally add a third state. It seemed like it already existed. I thought I saw an issue somewhere where it was discussed but I can't find it anymore so it's possible I hallucinated it entirely. I'm happy to implement either (1) or (2).

Make "always" and "enabled" semicolon rule behavior equivalent. In both
cases, don't require trailing semicolons for property-method
declarations.
@AndyMoreland
Copy link
Contributor Author

I believe I've addressed the comments here by going with option (1) from above.

@adidahiya
Copy link
Contributor

👍

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