lint.ts
9 documented symbols. Read the signatures first, then expand each item for parameters, return types, and examples.
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
Parameters
-
sourcestring -
optionsMarkdownLintOptionsoptional · default: {}
Returns
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>
Parameters
-
sourcestring -
optionsMarkdownLintOptionsoptional · default: {}
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[]>
Parameters
-
sourcesstring[] -
optionsMarkdownLintOptionsoptional · default: {}
Returns
Promise<MarkdownLintResult[]>
interfaceMarkdownLintDiagnosticA single Markdown lint diagnostic.
A single Markdown lint diagnostic.
Signature
export interface MarkdownLintDiagnostic
Members
Properties
| Name | Type | Description |
|---|---|---|
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
Members
Properties
| Name | Type | Description |
|---|---|---|
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
Members
Properties
| Name | Type | Description |
|---|---|---|
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 isomitted, 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
Members
Properties
| Name | Type | Description |
|---|---|---|
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
Members
Properties
| Name | Type | Description |
|---|---|---|
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
Members
Properties
| Name | Type | Description |
|---|---|---|
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) |