Skip to content

Multi-line ES6 import #2175

Closed
Closed
@supersteves

Description

@supersteves
import {
    something,
    somethingElse,
    inFactAVeryLongList,
    ofLotsOfThings,
    whichIsUglyOnOneLine
} from "./MyAllPurposeUtil";

This doesn't get picked up by the regex import scanning in Closure Compiler, because it assumes each statement is one per line:

https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/deps/JsFileParser.java#L41

Probably tough to fix. But also something that can be hard to diagnose.

Easy workaround:

import {
    ...
} from "./MyAllPurposeUtil";
import "./MyAllPurposeUtil"; // tell CC about this dep

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions