Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion crates/oxc_parser/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,9 @@ pub fn for_await(span: Span) -> OxcDiagnostic {

#[cold]
pub fn new_dynamic_import(span: Span) -> OxcDiagnostic {
OxcDiagnostic::error("Cannot use new with dynamic import").with_label(span)
OxcDiagnostic::error("Cannot use new with dynamic import")
.with_label(span)
.with_help("Wrap this with parenthesis")
}

#[cold]
Expand Down
2 changes: 2 additions & 0 deletions tasks/coverage/snapshots/parser_babel.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6120,6 +6120,7 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typesc
1 │ new import("foo");
· ─────────────
╰────
help: Wrap this with parenthesis

× Dynamic imports can only accept a module specifier and an optional set of attributes as arguments
╭─[babel/packages/babel-parser/test/fixtures/es2020/dynamic-import/multiple-args/input.js:1:1]
Expand Down Expand Up @@ -6158,6 +6159,7 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typesc
1 │ new import("foo");
· ─────────────
╰────
help: Wrap this with parenthesis

× Dynamic imports can only accept a module specifier and an optional set of attributes as arguments
╭─[babel/packages/babel-parser/test/fixtures/es2020/dynamic-import-createImportExpression-false/multiple-args/input.js:1:1]
Expand Down
Loading
Loading