Skip to content

Commit

Permalink
Use @types/nlcst
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Aug 27, 2021
1 parent fba13b8 commit d737c00
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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) => {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 7 additions & 1 deletion script/table.js
Original file line number Diff line number Diff line change
@@ -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')]),
Expand Down

0 comments on commit d737c00

Please sign in to comment.