Skip to content

Conversation

@marcosvega91
Copy link
Member

What:

Add arrow-body-style rule

Why:

Because we prefer to use braces around arrow function

How:

updating .eslintrc.js

Checklist:

  • Tests
  • Ready to be merged

@marcosvega91 marcosvega91 self-assigned this Jun 19, 2020
Copy link
Member

@smeijer smeijer left a comment

Choose a reason for hiding this comment

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

OMG this was a bad idea 😱 😬

How is this:

nodes: result.elements.map((x) => {
  return x.target;
})

better than this:?

nodes: result.elements.map((x) => x.target)

Let's not do this. I'm sorry for wasting your time on this 😇

@smeijer smeijer closed this Jun 19, 2020
@marcosvega91
Copy link
Member Author

I didn't like too but I thought for another comment that you want this

@smeijer
Copy link
Member

smeijer commented Jun 19, 2020

Yeah, I know which comment you're referring to. That's why I said, "This was a bad idea" 😬 (referring to my own suggestion to turn it into a PR)

I did find a way that works though, see #205.

Basically, I do favor { } in statements like if (false) { return } (as I burned my ass more than once by leaving them out), but not in arrow functions when they're not required.

#205 is the opposite of this PR. It removes all return statements from arrow functions when they're not required. I think that looks a lot cleaner 😄

@marcosvega91 marcosvega91 deleted the pr/add_arrow_body_style branch June 19, 2020 08:27
@marcosvega91
Copy link
Member Author

Yes I see is not a problem hahahah 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants