mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
feat(prettier): support longer source in ImportExpression (#1478)
This commit is contained in:
parent
7b909de28e
commit
79c2bac6b1
2 changed files with 9 additions and 6 deletions
|
|
@ -1679,14 +1679,18 @@ impl<'a> Format<'a> for ImportExpression<'a> {
|
|||
let mut parts = p.vec();
|
||||
parts.push(ss!("import"));
|
||||
parts.push(ss!("("));
|
||||
parts.push(format!(p, self.source));
|
||||
let mut indent_parts = p.vec();
|
||||
indent_parts.push(softline!());
|
||||
indent_parts.push(format!(p, self.source));
|
||||
if !self.arguments.is_empty() {
|
||||
for arg in &self.arguments {
|
||||
parts.push(ss!(","));
|
||||
parts.push(Doc::Line);
|
||||
parts.push(format!(p, arg));
|
||||
indent_parts.push(ss!(","));
|
||||
indent_parts.push(Doc::Line);
|
||||
indent_parts.push(format!(p, arg));
|
||||
}
|
||||
}
|
||||
parts.push(group!(p, Doc::Indent(indent_parts)));
|
||||
parts.push(softline!());
|
||||
parts.push(ss!(")"));
|
||||
|
||||
Doc::Group(Group::new(parts, false))
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
Compatibility: 132/601 (21.96%)
|
||||
Compatibility: 133/601 (22.13%)
|
||||
|
||||
# Failed
|
||||
|
||||
|
|
@ -643,7 +643,6 @@ Compatibility: 132/601 (21.96%)
|
|||
* throw_statement/jsx.js
|
||||
|
||||
### trailing-comma
|
||||
* trailing-comma/dynamic-import.js
|
||||
* trailing-comma/es5.js
|
||||
* trailing-comma/function-calls.js
|
||||
* trailing-comma/jsx.js
|
||||
|
|
|
|||
Loading…
Reference in a new issue