Skip to content

The first-line comment is been removed unexpectedly #11971

@HexMox

Description

@HexMox

Bug Report

  • I would like to work on a fix!

Current behavior
Babel removes the first-line comment unexpectedly.

Input Code

// test
import React from 'react';

export default class A extends B {}

Expected behavior
Keep the first-line comment(// test) in the output.

Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)

  • Filename: babel.config.js
{
  "presets": ["@babel/preset-env"]
  "plugins": ["@babel/plugin-transform-runtime"]
}
- Babel version(s): v7.11.1
- Node/npm version: Node 10.13
- OS: MacOS 10.14.5
- Monorepo: no
- How you are using Babel: Playground

Additional context
image

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions