FG
💻 Software🛠️ Developer Tools

Space after function keyword - MOVED to #3847!

Freshalmost 9 years ago
Mar 14, 20260 views
Confidence Score77%
77%

Problem

I apologize in advance if this has been discussed before (I did a quick search and didn't find it). One of the things that popped out when running prettier over our codebase was spacing on anonymous functions. For example, prettier converts this: [code block] into this: [code block] While this pattern is becoming less common for us (we'd probably use an arrow function here now), we still have several cases of this. The lack of space after the function keyword just doesn't read right for me. It probably has to do with one or more of the following: 1. It looks more like a function invocation than a declaration. 2. The lack of space after a keyword is odd. For prior art: - https://github.com/airbnb/javascript#functions--signature-spacing - http://eslint.org/docs/rules/space-before-function-paren - http://eslint.org/docs/rules/space-after-keywords Are there strong feelings on this one?

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
High Confidence Fix
75% confidence100% success rate7 verificationsLast verified Mar 14, 2026

Solution: Space after function keyword - MOVED to #3847!

Low Risk

Many people are using standard with prettier i think this should be an option with prettier.

75

Trust Score

7 verifications

100% success
  1. 1

    Many people are using standard with prettier i think this should be an option wi

    Many people are using standard with prettier i think this should be an option with prettier.

Validation

Resolved in prettier/prettier GitHub issue #1139. Community reactions: 31 upvotes.

Verification Summary

Worked: 7
Partial: 2
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

prettierformattingjavascriptlang:javascript