All files / validation wiki-linter.ts

75% Statements 6/8
100% Branches 0/0
0% Functions 0/2
85.71% Lines 6/7

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171x 1x 1x                     1x 1x 1x  
import { validateWikiContent } from './validate-wiki-content';
import { Diagnostic, linter, lintGutter, lintKeymap } from '@codemirror/lint';
import { EditorView, keymap } from '@codemirror/view';
 
function wikiLintSource(view: EditorView): readonly Diagnostic[] {
    return validateWikiContent(view.state.doc.toString()).map(err => ({
        from: err.from,
        to: err.to,
        severity: err.severity,
        message: err.message,
    }));
}
 
export const wikiLinter = linter(wikiLintSource);
export const wikiLintGutter = lintGutter();
export const wikiLintKeymap = keymap.of(lintKeymap);