lint.ts

Source

9 documented symbols. Read the signatures first, then expand each item for parameters, return types, and examples.

9 symbols 3 functions 6 interfaces 6 parameters 31 members 3 returns

Reference

fnlintMarkdown(source: string, options: MarkdownLintOptions = {}): MarkdownLintResultLints Markdown prose with the Rust-backed built-in rule engine.

Lints Markdown prose with the Rust-backed built-in rule engine.

Signature

export function lintMarkdown(source: string, options: MarkdownLintOptions = {}): MarkdownLintResult

View source

Parameters

Returns

MarkdownLintResult
fnlintMarkdownAsync(source: string, options: MarkdownLintOptions = {}): Promise<MarkdownLintResult>Async Markdown linter that supports opt-in standard dictionaries.

Async Markdown linter that supports opt-in standard dictionaries.

Signature

export async function lintMarkdownAsync(source: string, options: MarkdownLintOptions = {}): Promise<MarkdownLintResult>

View source

Parameters

Returns

Promise<MarkdownLintResult>
fnlintMarkdownDocumentsAsync(sources: string[], options: MarkdownLintOptions = {}): Promise<MarkdownLintResult[]>Internal batched Markdown linting entry point used by file-based workflows.

Internal batched Markdown linting entry point used by file-based workflows.

Signature

export async function lintMarkdownDocumentsAsync(sources: string[], options: MarkdownLintOptions = {}): Promise<MarkdownLintResult[]>

View source

Parameters

Returns

Promise<MarkdownLintResult[]>
interfaceMarkdownLintDiagnosticA single Markdown lint diagnostic.

A single Markdown lint diagnostic.

Signature

export interface MarkdownLintDiagnostic

View source

Members

Properties
NameTypeDescription
column number
1-indexed start column.
endColumn number
1-indexed end column.
endLine number
1-indexed end line.
languageoptional MarkdownLintLanguage
Language used for spellchecking, when relevant.
line number
1-indexed line number.
message string
Human-readable explanation.
ruleId string
Stable rule identifier.
severity MarkdownLintSeverity
Diagnostic severity.
suggestionsoptional string[]
Suggested replacements, when available.
interfaceMarkdownLintDictionaryOptionsAdditional dictionary configuration for the Markdown linter.

Additional dictionary configuration for the Markdown linter.

Signature

export interface MarkdownLintDictionaryOptions

View source

Members

Properties
NameTypeDescription
byLanguageoptional Partial<Record<MarkdownLintLanguage, string[]>>
Extra words to allow per language.
Default {}
ignoredWordsoptional string[]
Words that should never produce diagnostics.
Default []
standardoptional MarkdownLintStandardDictionaryOptions | false
Opt-in standard dictionary datasets.

By default the linter stays on a minimal built-in dictionary. Enable this
to load larger locale dictionaries from a standard external source.
Default false
wordsoptional string[]
Words ignored across all configured languages.
Default []
interfaceMarkdownLintOptionsOptions for linting Markdown documents.

Options for linting Markdown documents.

Signature

export interface MarkdownLintOptions

View source

Members

Properties
NameTypeDescription
dictionaryoptional MarkdownLintDictionaryOptions
Built-in and opt-in standard dictionary overrides.
Default {}
languagesoptional MarkdownLintLanguage[]
Languages enabled for spellchecking.

When dictionary.standard.languages is provided and this option is
omitted, those languages are used instead.
Default ['en']
rulesoptional MarkdownLintRuleOptions
Rule configuration.
Omitted fields use MarkdownLintRuleOptions defaults.
Default {}
interfaceMarkdownLintResultMarkdown lint report.

Markdown lint report.

Signature

export interface MarkdownLintResult

View source

Members

Properties
NameTypeDescription
diagnostics MarkdownLintDiagnostic[]
All collected diagnostics.
errorCount number
Number of error diagnostics.
infoCount number
Number of info diagnostics.
warningCount number
Number of warning diagnostics.
interfaceMarkdownLintRuleOptionsRule switches for Markdown linting.

Rule switches for Markdown linting.

Signature

export interface MarkdownLintRuleOptions

View source

Members

Properties
NameTypeDescription
duplicateHeadingsoptional boolean
Report headings that repeat the same visible text.
Default true
headingIncrementoptional boolean
Report heading depth jumps such as # -> ###.
Default true
maxConsecutiveBlankLinesoptional number
Maximum number of blank lines allowed in a row.
Default 1
repeatedPunctuationoptional boolean
Report duplicated terminal punctuation such as !! or ??.
Default true
repeatedWordsoptional boolean
Report adjacent repeated words in visible prose.
Default true
spellcheckoptional boolean
Enable built-in multilingual spellchecking.
Default true
trailingSpacesoptional boolean
Report trailing spaces.
Default true
interfaceMarkdownLintStandardDictionaryOptionsOpt-in standard dictionary sources. The default provider uses CSpell dictionary…

Opt-in standard dictionary sources.

The default provider uses CSpell dictionary packages because those packages are actively maintained and expose locale-specific dictionaries in a stable config format. Languages without a bundled preset can still be added through custom imports.

Signature

export interface MarkdownLintStandardDictionaryOptions

View source

Members

Properties
NameTypeDescription
importsoptional string[]
Additional CSpell-compatible imports.

This can point at installed packages like
@cspell/dict-fr-fr/cspell-ext.json or local CSpell config files.
Default []
languagesoptional MarkdownLintLanguage[]
Languages whose default standard dictionaries should be enabled.

Built-in preset package mappings currently exist for en, fr, de,
and pl. For other languages, use imports.
Default []
provideroptional "cspell"
Standard dictionary provider.
Default "cspell"
resolveImportsRelativeTooptional string | URL
Base URL or path used when resolving imports.
Default new URL(".", import.meta.url)