gtap-dev / javascript

JavaScript Style Guide
MIT License
0 stars 0 forks source link

Clarify 7.1, remove conflict with 13.5 #4

Closed mjomble closed 3 years ago

mjomble commented 3 years ago

I had originally planned to leave the longUniqueMoreDescriptiveLexicalFoo example in, but 13.5 makes a good point that this creates a global variable, even when using const or let. So I removed those examples entirely and added a simple arrow function one. A longer description should probably go in a comment instead.

Another thing I'm not sure about is whether non-arrow function expressions should be considered good? Perhaps we want to require arrow functions wherever possible and only allow function expressions when arrow functions can't be used.

mjomble commented 3 years ago

I also removed the "Don’t forget to explicitly name the expression" part, as it seems to be a pre-ES6 issue.