refactor: change return type of frontmatter extractor to use undefined

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2023-05-19 19:41:25 +02:00
parent 77f858bff8
commit 4d0a2cb79e
5 changed files with 29 additions and 56 deletions

View file

@ -20,7 +20,7 @@ export class FrontmatterLinter implements Linter {
lint(view: EditorView): Diagnostic[] {
const lines = view.state.doc.toString().split('\n')
const frontmatterExtraction = extractFrontmatter(lines)
if (!frontmatterExtraction.isPresent) {
if (frontmatterExtraction === undefined) {
return []
}
const startOfYaml = lines[0].length + 1