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

Parser doesn't recognize flow comments with leading spaces #9167

Closed
vikr01 opened this issue Dec 12, 2018 · 1 comment · Fixed by #9168
Closed

Parser doesn't recognize flow comments with leading spaces #9167

vikr01 opened this issue Dec 12, 2018 · 1 comment · Fixed by #9168
Labels
i: bug outdated A closed issue/PR that is archived due to age. Recommended to make a new issue

Comments

@vikr01
Copy link
Contributor

vikr01 commented Dec 12, 2018

Bug Report

Current Behavior

Using @babel/parser v7.2.0.

Flow comments are recognized as flow typings when they start with /*::, /*:, and /*flow-include, but when there's spaces it sees them as an ordinary comment (i.e. /* ::, /* : and /* flow-include).

Input Code

/* @flow */

import React, { Component/* ::, type Node */ } from 'react';

/*                          	flow-include
type Foo = string;
*/

Expected behavior/code
Spaces after the start of the comment should be considered the same as no spaces with flow comments.

The behavior for newlines after the start of the comment shouldn't change though, as flow still sees those as comments, i.e.:

/*
:: type Foo = string; */ // <- This should be seen as a comment

/*  :: type Foo = string */ // <- This should be seen as a typing
@vikr01 vikr01 added the i: bug label Dec 12, 2018
@babel-bot
Copy link
Collaborator

Hey @vikr01! 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.

@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Mar 15, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Mar 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
i: bug outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants