Space after function keyword in anonymous functions
Problem
NOTE: This issue is raised due to confusion in #1139. This issue is _only_ about _anonymous_ functions: [code block] (Prettier currently does _not_ put a space there.) > ๐ NOTE: This issue is _not_ about having a space after the function name: > > [code block] > > Space after function name is tracked in #3845! The key argument is: Consistency: This means that there's _always_ a space after the `function` keyword.
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: Space after function keyword in anonymous functions
+1 for space after `function` keyword. Crockford supports this: > If a function literal is anonymous, there should be one space between the word function and the ( left parenthesis. If the space is omitted, then it can appear that the function's name is function, which is an incorrect reading.
Trust Score
8 verifications
- 1
+1 for space after `function` keyword. Crockford supports this:
+1 for space after `function` keyword. Crockford supports this:
- 2
> If a function literal is anonymous, there should be one space between the word
> If a function literal is anonymous, there should be one space between the word function and the ( left parenthesis. If the space is omitted, then it can appear that the function's name is function, which is an incorrect reading.
Validation
Resolved in prettier/prettier GitHub issue #3847. Community reactions: 63 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep