Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Handle unnamed default exports like anonymous functions (fixes #3040) #3053

Conversation

IllusionMH
Copy link
Contributor

PR checklist

Overview of change:

This PR applies options for anonymous functions expression to default exports of function declarations without name.

Is there anything you'd like reviewers to focus on?

With this change there are no distinction between function declarations and function expression, therefore this two cases were combined.

There is no addition check for default in modifiers for FunctionDeclaration because other cases with omitted name are errors in TS/JS.

Optionally behavior for unnamed functions as default export might be controlled with separate options, however this is likely an overkill.

CHANGELOG.md entry:

[bugfix] space-before-function-paren Handle default exports of functions without names like anonymous functions (fixes #3040)

@jkillian
Copy link
Contributor

Thanks @IllusionMH and @ajafff!

@jkillian jkillian merged commit fcd0b98 into palantir:master Jul 19, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

space-before-function-paren doesn't detect anonymously exported function correctly
3 participants