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 9fb54fa commit 9d49357
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
10 changes: 4 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/**
* @typedef {import('nlcst').Root} Root
*
* @typedef {0|1|2|'newline'|'space'|'double-space'|null|undefined} Preferred
*
* @typedef Options
Expand All @@ -21,13 +23,9 @@ const source = 'retext-sentence-spacing'
* Plugin to check spacing between sentences.
* Emit warnings when the spacing does not adhere to the preferred style.
*
* @type {import('unified').Plugin<[Options?]>}
* @type {import('unified').Plugin<[Options?], Root>}
*/
export default function retextSentenceSpacing(options = {}) {
/**
* @typedef {import('unist').Parent} Parent
*/

let preferred = options.preferred

if (preferred === 'newline') {
Expand Down Expand Up @@ -55,7 +53,7 @@ export default function retextSentenceSpacing(options = {}) {
}

return (tree, file) => {
visit(tree, 'ParagraphNode', (/** @type {Parent} */ node) => {
visit(tree, 'ParagraphNode', (node) => {
let index = -1

while (++index < node.children.length) {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"index.js"
],
"dependencies": {
"@types/nlcst": "^1.0.0",
"@types/unist": "^2.0.0",
"nlcst-to-string": "^3.0.0",
"unified": "^10.0.0",
Expand Down

0 comments on commit 9d49357

Please sign in to comment.