babel / babylon

PSA: moved into babel/babel as @babel/parser -->

Home Page:https://github.com/babel/babel/tree/master/packages/babel-parser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Flow interfaces & `declare class` do not adhere to ASI

motiz88 opened this issue · comments

Input Code

declare class A {
  foo: boolean
  bar: string
}

declare interface B {
  foo: boolean
  bar: string
}

interface C {
  foo: boolean
  bar: string
}

Babylon/Babel Configuration

{
  "plugins": ["flow"]
}

Expected Behavior


UPDATE: My bad - Flow does emit errors in this case! So Babylon is actually already compatible with Flow.

### Current Behavior

Syntax errors on all three declarations, with Babylon expecting a semicolon or comma to separate the properties. 

### Your Environment

| software         | version
| ---------------- | -------
| Babylon          |  Same behaviour on 6.17.1, 7.0.0-beta.12 and latest `master` a4acf2d
commented

Hey @motiz88! We really appreciate you taking the time to report an issue. The collaborators
on this project attempt to help as many people as possible, but we're a limited number of volunteers,
so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack
community that typically always has someone willing to help. You can sign-up here
for an invite.

Closing this because Flow actually does emit errors in this case, and I just missed them in the AST Explorer UI.