Skip to content

Commit

Permalink
feat: add meta to processor
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Dec 5, 2023
1 parent 4d9dbd9 commit ff091c5
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/configs/markdown.ts
Expand Up @@ -21,9 +21,17 @@ export async function markdown(
// but not the markdown file itself. In order to format the whole markdown file,
// we need to create another virtual file for the markdown file itself.
const processor: Linter.Processor = !formatMarkdown
? baseProcessor
: {
? {
meta: {
name: 'markdown-processor',
},
supportsAutofix: true,
...baseProcessor,
}
: {
meta: {
name: 'markdown-processor-with-content',
},
postprocess(messages, filename) {
const markdownContent = messages.pop()
const codeSnippets = baseProcessor.postprocess(messages, filename)
Expand All @@ -42,6 +50,7 @@ export async function markdown(
},
]
},
supportsAutofix: true,
}

return [
Expand Down

0 comments on commit ff091c5

Please sign in to comment.