Skip to content

Commit

Permalink
fix(yaml): update parser (#4931)
Browse files Browse the repository at this point in the history
* test: add tests

* fix(yaml): update parser
  • Loading branch information
ikatyang committed Aug 3, 2018
1 parent 3b3240b commit 42ba638
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -60,8 +60,8 @@
"typescript-eslint-parser": "17.0.0",
"unicode-regex": "1.0.1",
"unified": "6.1.6",
"yaml": "1.0.0-rc.7",
"yaml-unist-parser": "1.0.0-rc.3"
"yaml": "ikatyang/yaml#a765c1ee16d6b8a5e715564645f2b85f7e04828b",
"yaml-unist-parser": "ikatyang/yaml-unist-parser#cd4f73325b3fc02a6d17842d0d9cee0dfc729c9b"
},
"devDependencies": {
"@babel/cli": "7.0.0-beta.55",
Expand Down
8 changes: 8 additions & 0 deletions tests/yaml_comment/__snapshots__/jsfmt.spec.js.snap
Expand Up @@ -94,6 +94,14 @@ A:
`;

exports[`in-empty-item-without-newlline.yml - yaml-verify 1`] = `
a:
#123~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a:
#123
`;

exports[`root.yml - yaml-verify 1`] = `
#hello world
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
2 changes: 2 additions & 0 deletions tests/yaml_comment/in-empty-item-without-newlline.yml
@@ -0,0 +1,2 @@
a:
#123
50 changes: 50 additions & 0 deletions tests/yaml_mapping/__snapshots__/jsfmt.spec.js.snap
Expand Up @@ -206,6 +206,56 @@ key:
`;

exports[`merge-twice.yml - yaml-verify 1`] = `
.anchors:
- &anchor1
key: value
- &anchor2
another: prop
foo:
bar: baz
<<: *anchor1
<<: *anchor2
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.anchors:
- &anchor1
key: value
- &anchor2
another: prop
foo:
bar: baz
<<: *anchor1
<<: *anchor2
`;

exports[`merge-twice.yml - yaml-verify 2`] = `
.anchors:
- &anchor1
key: value
- &anchor2
another: prop
foo:
bar: baz
<<: *anchor1
<<: *anchor2
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.anchors:
- &anchor1
key: value
- &anchor2
another: prop
foo:
bar: baz
<<: *anchor1
<<: *anchor2
`;

exports[`middle-comment.yml - yaml-verify 1`] = `
!!map # comment
a: 123
Expand Down
10 changes: 10 additions & 0 deletions tests/yaml_mapping/merge-twice.yml
@@ -0,0 +1,10 @@
.anchors:
- &anchor1
key: value
- &anchor2
another: prop

foo:
bar: baz
<<: *anchor1
<<: *anchor2
8 changes: 4 additions & 4 deletions yarn.lock
Expand Up @@ -6086,16 +6086,16 @@ yallist@^3.0.0, yallist@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.2.tgz#8452b4bb7e83c7c188d8041c1a837c773d6d8bb9"

yaml-unist-parser@1.0.0-rc.3:
yaml-unist-parser@ikatyang/yaml-unist-parser#cd4f73325b3fc02a6d17842d0d9cee0dfc729c9b:
version "1.0.0-rc.3"
resolved "https://registry.yarnpkg.com/yaml-unist-parser/-/yaml-unist-parser-1.0.0-rc.3.tgz#d7b396353da92c75bb471a9e65973ba967e0b4f6"
resolved "https://codeload.github.com/ikatyang/yaml-unist-parser/tar.gz/cd4f73325b3fc02a6d17842d0d9cee0dfc729c9b"
dependencies:
lines-and-columns "^1.1.6"
tslib "^1.9.1"

yaml@1.0.0-rc.7:
yaml@ikatyang/yaml#a765c1ee16d6b8a5e715564645f2b85f7e04828b:
version "1.0.0-rc.7"
resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.0.0-rc.7.tgz#7cf9dba3c78992542b7a2d7cb9a7eeacbff63f77"
resolved "https://codeload.github.com/ikatyang/yaml/tar.gz/a765c1ee16d6b8a5e715564645f2b85f7e04828b"

yargs-parser@^7.0.0:
version "7.0.0"
Expand Down

0 comments on commit 42ba638

Please sign in to comment.