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 0ba4cdb commit 3a77ebc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/**
* @typedef {import('nlcst').Root} Root
* @typedef {import('nlcst').Sentence} Sentence
*
* @typedef Options
* Configuration.
* @property {boolean} [allowLiterals=false]
Expand All @@ -24,14 +27,15 @@ const data = initialize()
/**
* Plugin to check contractions use.
*
* @type {import('unified').Plugin<[Options?]>}
* @type {import('unified').Plugin<[Options?], Root>}
*/
export default function retextContractions(options = {}) {
const ignore = options.allowLiterals
const straight = options.straight

return (tree, file) => {
visit(tree, 'WordNode', (node, index, parent) => {
visit(tree, 'WordNode', (node, index, parent_) => {
const parent = /** @type {Sentence} */ (parent_)
const actual = toString(node)
const normal = actual.replace(/['’]/g, '')

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 @@
"list.js"
],
"dependencies": {
"@types/nlcst": "^1.0.0",
"nlcst-is-literal": "^2.0.0",
"nlcst-to-string": "^3.0.0",
"unified": "^10.0.0",
Expand Down

0 comments on commit 3a77ebc

Please sign in to comment.