lint-files.ts
7 documented symbols. Read the signatures first, then expand each item for parameters, return types, and examples.
Reference
fnlintMarkdownFile(filePath: string, options: MarkdownLintFileOptions = {}): Promise<MarkdownLintFileResult>Lints a single Markdown file using project-style include/exclude settings. If t…
Lints a single Markdown file using project-style include/exclude settings.
If the file is filtered out by include / exclude, the returned result is marked as skipped and contains no diagnostics.
Signature
export async function lintMarkdownFile(filePath: string, options: MarkdownLintFileOptions = {}): Promise<MarkdownLintFileResult>
Parameters
-
filePathstring -
optionsMarkdownLintFileOptionsoptional · default: {}
Returns
Promise<MarkdownLintFileResult>
fnlintMarkdownFiles(options: MarkdownLintFileOptions = {}): Promise<MarkdownLintFilesResult>Lints all Markdown files matched by the configured include/exclude patterns.
Lints all Markdown files matched by the configured include/exclude patterns.
Signature
export async function lintMarkdownFiles(options: MarkdownLintFileOptions = {}): Promise<MarkdownLintFilesResult>
Parameters
-
optionsMarkdownLintFileOptionsoptional · default: {}
Returns
Promise<MarkdownLintFilesResult>
interfaceMarkdownLintFileDiagnostic extends MarkdownLintDiagnosticA lint diagnostic annotated with file metadata.
A lint diagnostic annotated with file metadata.
Signature
export interface MarkdownLintFileDiagnostic extends MarkdownLintDiagnostic
Members
Properties
| Name | Type | Description |
|---|---|---|
filePath |
string |
|
relativePath |
string |
interfaceMarkdownLintFileOptions extends MarkdownLintOptionsFile-oriented Markdown lint options for end-user configuration. This extends th…
File-oriented Markdown lint options for end-user configuration.
This extends the content-level lint options with project-level targeting, so consumers can decide which files should be checked and which paths should be ignored.
Signature
export interface MarkdownLintFileOptions extends MarkdownLintOptions
Members
Properties
| Name | Type | Description |
|---|---|---|
cwdoptional |
string |
Base directory used to resolve include and exclude patterns.Default process.cwd() |
excludeoptional |
string[] |
Glob patterns for files to exclude from linting. Default ['**\/node_modules/**', '**\/.git/**', '**\/dist/**'] |
ignoreoptional |
string[] |
Alias of exclude.When omitted, only exclude is used.Default undefined |
includeoptional |
string[] |
Glob patterns for files to lint. Default ['**\/*.md', '**\/*.markdown', '**\/*.mdx'] |
interfaceMarkdownLintFileResult extends MarkdownLintResultLint result for a single file.
Lint result for a single file.
Signature
export interface MarkdownLintFileResult extends MarkdownLintResult
Members
Properties
| Name | Type | Description |
|---|---|---|
filePath |
string |
|
relativePath |
string |
|
skipped |
boolean |
interfaceMarkdownLintFilesResultAggregated lint result for multiple files.
Aggregated lint result for multiple files.
Signature
export interface MarkdownLintFilesResult
Members
Properties
| Name | Type | Description |
|---|---|---|
checkedFileCount |
number |
|
diagnostics |
MarkdownLintFileDiagnostic[] |
|
errorCount |
number |
|
files |
MarkdownLintFileResult[] |
|
infoCount |
number |
|
warningCount |
number |
fnshouldLintMarkdownFile(filePath: string, options: MarkdownLintFileOptions = {}): booleanReturns true if the file path is included by the configured glob filters.
Returns true if the file path is included by the configured glob filters.
Signature
export function shouldLintMarkdownFile(filePath: string, options: MarkdownLintFileOptions = {}): boolean
Parameters
-
filePathstring -
optionsMarkdownLintFileOptionsoptional · default: {}
Returns
boolean