From d737c00627623c6f162cdc9709cd9f62efe0da74 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Fri, 27 Aug 2021 15:37:10 +0200 Subject: [PATCH] Use `@types/nlcst` --- index.js | 6 +++++- package.json | 1 + script/table.js | 8 +++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index fcff32c..db429b7 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,7 @@ +/** + * @typedef {import('nlcst').Root} Root + */ + import {matchCasing} from 'match-casing' import {search} from 'nlcst-search' import {toString} from 'nlcst-to-string' @@ -12,7 +16,7 @@ const list = Object.keys(schema) /** * Plugin to check for proper use of diacritics. * - * @type {import('unified').Plugin<[]>} + * @type {import('unified').Plugin<[], Root>} */ export default function retextDiacritics() { return (tree, file) => { diff --git a/package.json b/package.json index 6888953..5955990 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,7 @@ "schema.js" ], "dependencies": { + "@types/nlcst": "^1.0.0", "match-casing": "^2.0.0", "nlcst-search": "^3.0.0", "nlcst-to-string": "^3.0.0", diff --git a/script/table.js b/script/table.js index 45a6c54..11fe220 100644 --- a/script/table.js +++ b/script/table.js @@ -1,11 +1,17 @@ +/** + * @typedef {import('mdast').Root} Root + * @typedef {import('mdast').TableContent} TableContent + */ + import {zone} from 'mdast-zone' import {u} from 'unist-builder' import {schema} from '../schema.js' -/** @type {import('unified').Plugin<[]>} */ +/** @type {import('unified').Plugin<[], Root>} */ export default function table() { return (tree) => { zone(tree, 'messages', (start, _, end) => { + /** @type {TableContent[]} */ const rows = [ u('tableRow', [ u('tableCell', [u('inlineCode', 'source')]),