refactor: remove ts-ignore

This commit is contained in:
Philipp Kühn
2021-05-13 15:02:22 +02:00
parent ac060723dc
commit 185e1c40af

View File

@@ -32,9 +32,7 @@ function getDecorations({ doc, name, lowlight }: { doc: ProsemirrorNode, name: s
.forEach(block => { .forEach(block => {
let from = block.pos + 1 let from = block.pos + 1
const { language } = block.node.attrs const { language } = block.node.attrs
// TODO: add missing type for `listLanguages` const languages = lowlight.listLanguages()
// @ts-ignore
const languages = lowlight.listLanguages() as string[]
const nodes = language && languages.includes(language) const nodes = language && languages.includes(language)
? lowlight.highlight(language, block.node.textContent).value ? lowlight.highlight(language, block.node.textContent).value
: lowlight.highlightAuto(block.node.textContent).value : lowlight.highlightAuto(block.node.textContent).value