prettier / yaml-unist-parser Goto Github PK
View Code? Open in Web Editor NEWA YAML parser that produces output compatible with unist
License: MIT License
A YAML parser that produces output compatible with unist
License: MIT License
the dependency yaml
has been changed a lot, can you please update it?
I was not able to fix issues in #281
@sosukesuzuki Can you work on it?
Version
Input
parent:
one: 1
# two: 2
Output
The comment is attached to children in documentBody.
Expected
The comment is attached to endComments in parent
's mappingValue.
Original post: prettier/prettier#4917
Context: prettier/prettier#4563 (comment)
Waiting for the patch release for
When updating yaml to v1.10.0
can't parse following code
empty block scalar: >
# comment
[email protected]
has been released for a while, it will be great if we can support that.
map:
# with CRLF this comment causes: Unexpected leading character "\n"
It works fine with LF line endings.
Also this library is great! ๐
https://unpkg.com/browse/[email protected]/lib/transforms/document-head.js
Line 11 use __spreadArrays
, this requires [email protected]
, but the version requirement in package.json is ^1.9.1
https://github.com/ikatyang/yaml-unist-parser/blob/2617e8aaede2272d912dffe7f21a2b3b654ea9fe/package.json#L30 causes error
https://palantir.github.io/tslint/
โ ๏ธ TSLint has been deprecated as of 2019. Please see this issue for more details: Roadmap: TSLint โ ESLint. typescript-eslint is now your best option for linting TypeScript.
tslint has been deprecated, so we need to migrate typescript-eslint.
# --
"position": {
"start": { "offset": 0, "line": 1, "column": 1 },
"end": { "offset": 0, "line": 1, "column": 1 }
},
# ---
"position": {
"start": { "offset": 2, "line": 1, "column": 3 },
"end": { "offset": 5, "line": 1, "column": 6 }
},
Prettier issue prettier/prettier#8378
foo:
<<: &anchor
K1: "One"
K2: "Two"
bar:
<<: *anchor
K3: "Three"
In this, comment 1 is attached as endComments
,
- a
# comment 1
- b
# comment 2
When next one is longer, comment 1 is attached as leadingComments
,
- a
# comment 1
- bb
# comment 2
Same problem in map
a:
# comment 1
b:
# comment 2
VS
a:
# comment 1
bb:
# comment 2
Context: prettier/prettier#9143 (comment)
Any plans to implement stringify? This would make it a full unified processor ๐
Prettier v3 supports Node.js >= 14.x so I think that yaml-unist-parser
also should drop Node.js <= 12.x.
(It will be breaking change, so we need major release)
Hi, while the parser is compatible with unist, the types do not seem to be compatible. Using the visit
function from unist-util-visit
, I get the following type error:
Argument of type 'Root' is not assignable to parameter of type 'Node'.
Index signature is missing in type 'Root'.
key: &anchor
# comment
- value
comment is attached as sequence.middleComments
, maybe better sequenceItem.leadingComments
?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.