Skip to content

Commit

Permalink
Update @type/mdast, unified, utilities
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Sep 14, 2023
1 parent cc280b5 commit cf244cd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ export default function remarkFrontmatter(options = 'yaml') {
function add(field, value) {
const list = /** @type {unknown[]} */ (
// Other extensions
/* c8 ignore next 2 */
/* c8 ignore next 3 */
// @ts-expect-error: to do: remove when remark is released.
data[field] ? data[field] : (data[field] = [])
)

Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
"index.js"
],
"dependencies": {
"@types/mdast": "^3.0.0",
"mdast-util-frontmatter": "^1.0.0",
"micromark-extension-frontmatter": "^1.0.0",
"unified": "^10.0.0"
"@types/mdast": "^4.0.0",
"mdast-util-frontmatter": "^2.0.0",
"micromark-extension-frontmatter": "^2.0.0",
"unified": "^11.0.0"
},
"devDependencies": {
"@types/tape": "^5.0.0",
Expand All @@ -50,9 +50,10 @@
"remark-preset-wooorm": "^9.0.0",
"rimraf": "^3.0.0",
"tape": "^5.0.0",
"to-vfile": "^7.0.0",
"to-vfile": "^8.0.0",
"type-coverage": "^2.0.0",
"typescript": "^5.0.0",
"vfile": "^6.0.0",
"xo": "^0.56.0"
},
"scripts": {
Expand Down
5 changes: 5 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import remarkFrontmatter from '../index.js'

test('remarkFrontmatter', (t) => {
t.doesNotThrow(() => {
// @ts-expect-error: remove when remark is released.
remark().use(remarkFrontmatter).freeze()
}, 'should not throw if not passed options')

Expand Down Expand Up @@ -91,7 +92,10 @@ test('fixtures', (t) => {
)
} catch {}

// @ts-expect-error: remove when remark is released.
const proc = remark().use(remarkFrontmatter, config)
/** @type {Root} */
// @ts-expect-error: remove when remark is released.
const actual = proc.parse(input)

try {
Expand All @@ -112,6 +116,7 @@ test('fixtures', (t) => {
}

st.deepEqual(actual, expected, 'tree')
// @ts-expect-error: remove when remark is released.
st.equal(String(proc.processSync(input)), String(output), 'process')
st.end()
})
Expand Down

0 comments on commit cf244cd

Please sign in to comment.