Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -806,8 +806,9 @@ Other Style Guides
const h = function() {};

// good
const x = function () {};
const x = () => {};
Copy link
Collaborator

Choose a reason for hiding this comment

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

an arrow function doesn't have the spacing issue this section is concerned with; the fact that function () {} is bad doesn't mean it's not useful in this example.

I'm fine adding the arrow, but we need to keep the function () {}.

Copy link
Author

Choose a reason for hiding this comment

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

@ljharb Yea I was thinking about that after I made the PR - added line 811 with a function that has a longer lexical name

Copy link
Author

Choose a reason for hiding this comment

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

@ljharb You're probably right, it's too trivial of an inconsistency to not keep what is currently in the doc

const y = function a() {};
const z = function abc() {};
```

<a name="functions--mutate-params"></a><a name="7.12"></a>
Expand Down