Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Semicolon before arrow IIFE #2800

Closed
rkurbatov opened this issue Sep 13, 2017 · 1 comment
Closed

Semicolon before arrow IIFE #2800

rkurbatov opened this issue Sep 13, 2017 · 1 comment
Labels
locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. type:question Questions and support requests. Please use Stack Overflow for them, not the issue tracker.

Comments

@rkurbatov
Copy link
Contributor

Prettier Version: 1.6.1 / master

Code

(playground)

(async () => {})()

Actual behavior:

Semicolon is added before IIFE if --no-semi param is used. Is it required here?

;(async () => {})()
@ikatyang
Copy link
Member

Hi, thanks for the issue. That semicolon is not required there, but it's the most consistent way to print with --no-semi, the rules that prettier followed to prevent problems from ASI (Automatic Semicolon Insertion) can be found in #1129 (comment):

Prefix ExpressionStatements with a semicolon when they "start with" one of the following:

  • Array, +Unary, -Unary, Template String, JSXElement, Regex
  • Any expression wrapped in parens

And there's also related discussions in #12.

@ikatyang ikatyang added the type:question Questions and support requests. Please use Stack Overflow for them, not the issue tracker. label Sep 13, 2017
@lock lock bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Jul 6, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jul 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. type:question Questions and support requests. Please use Stack Overflow for them, not the issue tracker.
Projects
None yet
Development

No branches or pull requests

2 participants