Preserve attributes order for element node#10958
Conversation
| /* ElementNode print helpers */ | ||
|
|
||
| function sortByLoc(a, b) { | ||
| if (a.loc.start.line < b.loc.start.line) { |
There was a problem hiding this comment.
return (a.loc.start.line - b.loc.start.line) || (a.loc.start.column - b.loc.start.column)
There was a problem hiding this comment.
We also have .offset added in #9626, so a.loc.start.offset - b.loc.start.offset or locStart(a) - locStart(b) like js printer
| isNonEmptyArray(node[property]) | ||
| ); | ||
| const attributes = types | ||
| .reduce((acc, type) => [...acc, ...node[type]], []) |
There was a problem hiding this comment.
| .reduce((acc, type) => [...acc, ...node[type]], []) | |
| .flatMap((type) => node[type]) |
| {{! this is a comment for arg 5}} | ||
| @arg5="hello" | ||
| ...arguments | ||
| /> |
There was a problem hiding this comment.
Can we make this example a little shorter?
There was a problem hiding this comment.
Oops. Sorry, missed this comment, but IMHO it's good as is.
There was a problem hiding this comment.
It is odd, I thought I applied the change. If you think it's worth correcting, I'll open a PR
There was a problem hiding this comment.
It'll be a minor release without a blog post, so it's okay, don't bother
Description
Closes #10203
Checklist
docs/directory).changelog_unreleased/*/XXXX.mdfile followingchangelog_unreleased/TEMPLATE.md.✨Try the playground for this PR✨