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

Plugin insists on removing empty line between imports and a semicolon (;) #12

Closed
IlyaSemenov opened this issue May 9, 2019 · 2 comments
Labels
bug Something isn't working

Comments

@IlyaSemenov
Copy link

The plugin insists on removing the delimiting empty line between the imports and a semicolon. This affects, for example, inline function calls (which are prepended with a semicolon by prettier).

Example:

import { foo } from "bar"

;(async function() {
  await foo()
})()

See screenshots:

Screenshot 2019-05-09 at 13 13 03

Screenshot 2019-05-09 at 13 13 13

The "fixed" version:

Screenshot 2019-05-09 at 13 13 17

Expected behaviour

Allow empty line between imports and a block starting with a semicolon (as on screenshot 1).

If you need a reproduction repo I can create one. But I think the problem will repeat if you just copy/paste my example to any environment.

@lydell
Copy link
Owner

lydell commented May 9, 2019

Good catch, I didn’t think about semicolon-less JS style. The plugin thinks that the semicolon belongs to the import statement (although with weird whitespace).

@lydell lydell added the bug Something isn't working label May 9, 2019
@lydell lydell closed this as completed in 410700f May 16, 2019
@lydell
Copy link
Owner

lydell commented May 16, 2019

Fixed in v3.1.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants