fix: issue #6813 (Zero-based lists are broken)#6852
Conversation
dfe9e6f to
2a23b71
Compare
|
/cc @prettier/core somebody can review 😄 ? |
j-f1
left a comment
There was a problem hiding this comment.
A couple suggested renames & a comment about the algorithm:
2a23b71 to
afd66ce
Compare
|
/cc @j-f1 can you approve? |
|
how about const [firstNumber, secondNumber, thirdNumber] = node.children
.slice(0, 3)
.filter(Boolean)
.map(child =>
Number(getOrderedListItemInfo(child, options.originalText).numberText)
); |
|
thirdNumber may not exist, also it is unnecessary get third node when list contains only 2 items |
|
I used |
|
@lydell why 2? |
|
There are a lot of changes for the second version, we should still have an intermediate version 1.20 |
|
The plan is to release 2.0 early January 2020. I don’t think we’ll be able to jam another release in between. It’s just two months away and there’s Christmas and all.
Which changes are you referring to? Have you seen the updated plans? |
|
/cc @lydell should i use master because it is not breaking change? |
|
Yes, sounds good. |
afd66ce to
37126c0
Compare
37126c0 to
5feb4f0
Compare
| return { numberText, marker, leadingSpaces }; | ||
| } | ||
|
|
||
| function hasGitDiffFriendlyOrderedList(node, options) { |
There was a problem hiding this comment.
why not name hasDiffFriendlyOrderedList
There was a problem hiding this comment.
Because it is git diff, not diff, it is original name and i keep it, so it is out of this PR
* 'next' of github.com:prettier/prettier: Optimize some usage of `Array#filter` (#6996) Update `jest` to v24 (#6954) Replace `trim{Left,Right}` with `trim{Start,End}` (#6994) Set `trailingComma` default value to `es5` (#6963) Fix `new` usage for builtin objects (#6968) Replace `indexOf` with `includes` (#6967) fix: tests for empty type parameters in TS (#6960) Fix MDX html parsing errors (#6949) fix: issue #6813 (Zero-based lists are broken) (#6852) Style: use async functions (#6935) Disable trailingComma for Angular internal parser (#6912) Update `snapshot-diff` to v0.6.1 (#6955) Update build scripts to target Node.js 10 (#6908)
docs/directory)CHANGELOG.unreleased.mdfile following the template.✨Try the playground for this PR✨
fixes #6813 + many tests