Skip to content

Markdown Plugin

Rules for linting .md files containing Markdown, the lightweight markup language.
This plugin comes packaged with the flint npm package.

Flint’s Markdown plugin provides the following presets:

PresetRecommendedDescription
logical✅ AlwaysCommon rules for finding bugs and enforcing good logical practices in Markdown files.
logicalStrict☑️ When ReadyAdditional rules for finding bugs and enforcing good logical practices in Markdown files.
stylistic✅ AlwaysCommon rules for consistent styling and best stylistic practices in Markdown files.
stylisticStrict☑️ When ReadyAdditional rules for consistent styling and best stylistic practices in Markdown files.

If you are just getting started with linting, Flint recommends using the logical and stylistic presets:

flint.config.ts
import {
function defineConfig(definition: ConfigDefinition): Config

Defines a new linter configuration for a Flint config file.

@seehttps://flint.fyi/configuration flint.fyi/configuration

defineConfig
,
const md: Plugin<RuleAbout, "all", [Rule<{
readonly description: "Reports bare URLs that should be formatted as autolinks or links.";
readonly id: "bareUrls";
readonly presets: ["stylistic", "stylisticStrict"];
} & {
presets?: ("logical" | "logicalStrict" | "stylistic" | "stylisticStrict")[];
url: string;
}, object, object, "bareUrl", AnyOptionalSchema>, Rule<{
readonly description: "Reports definitions with empty URLs or only empty fragments.";
readonly id: "definitionContents";
readonly presets: ["logical"];
} & {
presets?: ("logical" | "logicalStrict" | "stylistic" | "stylisticStrict")[];
url: string;
}, object, object, "emptyDefinition", AnyOptionalSchema>, ... 13 more ..., Rule<...>]>
md
} from "flint";
export default
function defineConfig(definition: ConfigDefinition): Config

Defines a new linter configuration for a Flint config file.

@seehttps://flint.fyi/configuration flint.fyi/configuration

defineConfig
({
ConfigDefinition.use: ConfigUseDefinition[]

Specifies the files to be linted alongside the rules and settings to lint with.

@seehttps://flint.fyi/configuration#use flint.fyi/configuration#use

use
: [
{
ConfigUseDefinition.files: AnyLevelDeep<FilesValue>

A list of glob patterns describing which file(s) to lint.

@seehttps://flint.fyi/configuration#files flint.fyi/configuration#files

files
:
const md: Plugin<RuleAbout, "all", [Rule<{
readonly description: "Reports bare URLs that should be formatted as autolinks or links.";
readonly id: "bareUrls";
readonly presets: ["stylistic", "stylisticStrict"];
} & {
presets?: ("logical" | "logicalStrict" | "stylistic" | "stylisticStrict")[];
url: string;
}, object, object, "bareUrl", AnyOptionalSchema>, Rule<{
readonly description: "Reports definitions with empty URLs or only empty fragments.";
readonly id: "definitionContents";
readonly presets: ["logical"];
} & {
presets?: ("logical" | "logicalStrict" | "stylistic" | "stylisticStrict")[];
url: string;
}, object, object, "emptyDefinition", AnyOptionalSchema>, ... 13 more ..., Rule<...>]>
md
.
Plugin<RuleAbout, "all", [Rule<{ readonly description: "Reports bare URLs that should be formatted as autolinks or links."; readonly id: "bareUrls"; readonly presets: [...]; } & { ...; }, object, object, "bareUrl", AnyOptionalSchema>, ... 14 more ..., Rule<...>]>.files: Record<"all", FilesValue>

Selectors of files this plugin suggests applying its rules to.

@seehttps://flint.fyi/glossary#files flint.fyi/glossary#files

files
.
all: FilesValue
all
,
ConfigUseDefinition.rules: AnyLevelDeep<ConfigRuleDefinition>

Any number of rules and/or presets of rules to enable for those files.

@seehttps://flint.fyi/configuration#rules flint.fyi/configuration#rules

rules
: [
const md: Plugin<RuleAbout, "all", [Rule<{
readonly description: "Reports bare URLs that should be formatted as autolinks or links.";
readonly id: "bareUrls";
readonly presets: ["stylistic", "stylisticStrict"];
} & {
presets?: ("logical" | "logicalStrict" | "stylistic" | "stylisticStrict")[];
url: string;
}, object, object, "bareUrl", AnyOptionalSchema>, Rule<{
readonly description: "Reports definitions with empty URLs or only empty fragments.";
readonly id: "definitionContents";
readonly presets: ["logical"];
} & {
presets?: ("logical" | "logicalStrict" | "stylistic" | "stylisticStrict")[];
url: string;
}, object, object, "emptyDefinition", AnyOptionalSchema>, ... 13 more ..., Rule<...>]>
md
.
Plugin<RuleAbout, "all", [Rule<{ readonly description: "Reports bare URLs that should be formatted as autolinks or links."; readonly id: "bareUrls"; readonly presets: [...]; } & { ...; }, object, object, "bareUrl", AnyOptionalSchema>, ... 14 more ..., Rule<...>]>.presets: PluginPresets<RuleAbout, "logical" | "logicalStrict" | "stylistic" | "stylisticStrict">

Preset lists of rules to enable on files.

@seehttps://flint.fyi/glossary#preset flint.fyi/glossary#preset

presets
.
logical: Rule<RuleAbout, object, object, string, AnyOptionalSchema | undefined>[]
logical
,
const md: Plugin<RuleAbout, "all", [Rule<{
readonly description: "Reports bare URLs that should be formatted as autolinks or links.";
readonly id: "bareUrls";
readonly presets: ["stylistic", "stylisticStrict"];
} & {
presets?: ("logical" | "logicalStrict" | "stylistic" | "stylisticStrict")[];
url: string;
}, object, object, "bareUrl", AnyOptionalSchema>, Rule<{
readonly description: "Reports definitions with empty URLs or only empty fragments.";
readonly id: "definitionContents";
readonly presets: ["logical"];
} & {
presets?: ("logical" | "logicalStrict" | "stylistic" | "stylisticStrict")[];
url: string;
}, object, object, "emptyDefinition", AnyOptionalSchema>, ... 13 more ..., Rule<...>]>
md
.
Plugin<RuleAbout, "all", [Rule<{ readonly description: "Reports bare URLs that should be formatted as autolinks or links."; readonly id: "bareUrls"; readonly presets: [...]; } & { ...; }, object, object, "bareUrl", AnyOptionalSchema>, ... 14 more ..., Rule<...>]>.presets: PluginPresets<RuleAbout, "logical" | "logicalStrict" | "stylistic" | "stylisticStrict">

Preset lists of rules to enable on files.

@seehttps://flint.fyi/glossary#preset flint.fyi/glossary#preset

presets
.
stylistic: Rule<RuleAbout, object, object, string, AnyOptionalSchema | undefined>[]
stylistic
],
},
],
});

If you are experienced with both Markdown and linting, Flint recommends using the logicalStrict and stylisticStrict presets:

flint.config.ts
import {
function defineConfig(definition: ConfigDefinition): Config

Defines a new linter configuration for a Flint config file.

@seehttps://flint.fyi/configuration flint.fyi/configuration

defineConfig
,
const md: Plugin<RuleAbout, "all", [Rule<{
readonly description: "Reports bare URLs that should be formatted as autolinks or links.";
readonly id: "bareUrls";
readonly presets: ["stylistic", "stylisticStrict"];
} & {
presets?: ("logical" | "logicalStrict" | "stylistic" | "stylisticStrict")[];
url: string;
}, object, object, "bareUrl", AnyOptionalSchema>, Rule<{
readonly description: "Reports definitions with empty URLs or only empty fragments.";
readonly id: "definitionContents";
readonly presets: ["logical"];
} & {
presets?: ("logical" | "logicalStrict" | "stylistic" | "stylisticStrict")[];
url: string;
}, object, object, "emptyDefinition", AnyOptionalSchema>, ... 13 more ..., Rule<...>]>
md
} from "flint";
export default
function defineConfig(definition: ConfigDefinition): Config

Defines a new linter configuration for a Flint config file.

@seehttps://flint.fyi/configuration flint.fyi/configuration

defineConfig
({
ConfigDefinition.use: ConfigUseDefinition[]

Specifies the files to be linted alongside the rules and settings to lint with.

@seehttps://flint.fyi/configuration#use flint.fyi/configuration#use

use
: [
{
ConfigUseDefinition.files: AnyLevelDeep<FilesValue>

A list of glob patterns describing which file(s) to lint.

@seehttps://flint.fyi/configuration#files flint.fyi/configuration#files

files
:
const md: Plugin<RuleAbout, "all", [Rule<{
readonly description: "Reports bare URLs that should be formatted as autolinks or links.";
readonly id: "bareUrls";
readonly presets: ["stylistic", "stylisticStrict"];
} & {
presets?: ("logical" | "logicalStrict" | "stylistic" | "stylisticStrict")[];
url: string;
}, object, object, "bareUrl", AnyOptionalSchema>, Rule<{
readonly description: "Reports definitions with empty URLs or only empty fragments.";
readonly id: "definitionContents";
readonly presets: ["logical"];
} & {
presets?: ("logical" | "logicalStrict" | "stylistic" | "stylisticStrict")[];
url: string;
}, object, object, "emptyDefinition", AnyOptionalSchema>, ... 13 more ..., Rule<...>]>
md
.
Plugin<RuleAbout, "all", [Rule<{ readonly description: "Reports bare URLs that should be formatted as autolinks or links."; readonly id: "bareUrls"; readonly presets: [...]; } & { ...; }, object, object, "bareUrl", AnyOptionalSchema>, ... 14 more ..., Rule<...>]>.files: Record<"all", FilesValue>

Selectors of files this plugin suggests applying its rules to.

@seehttps://flint.fyi/glossary#files flint.fyi/glossary#files

files
.
all: FilesValue
all
,
ConfigUseDefinition.rules: AnyLevelDeep<ConfigRuleDefinition>

Any number of rules and/or presets of rules to enable for those files.

@seehttps://flint.fyi/configuration#rules flint.fyi/configuration#rules

rules
: [
const md: Plugin<RuleAbout, "all", [Rule<{
readonly description: "Reports bare URLs that should be formatted as autolinks or links.";
readonly id: "bareUrls";
readonly presets: ["stylistic", "stylisticStrict"];
} & {
presets?: ("logical" | "logicalStrict" | "stylistic" | "stylisticStrict")[];
url: string;
}, object, object, "bareUrl", AnyOptionalSchema>, Rule<{
readonly description: "Reports definitions with empty URLs or only empty fragments.";
readonly id: "definitionContents";
readonly presets: ["logical"];
} & {
presets?: ("logical" | "logicalStrict" | "stylistic" | "stylisticStrict")[];
url: string;
}, object, object, "emptyDefinition", AnyOptionalSchema>, ... 13 more ..., Rule<...>]>
md
.
Plugin<RuleAbout, "all", [Rule<{ readonly description: "Reports bare URLs that should be formatted as autolinks or links."; readonly id: "bareUrls"; readonly presets: [...]; } & { ...; }, object, object, "bareUrl", AnyOptionalSchema>, ... 14 more ..., Rule<...>]>.presets: PluginPresets<RuleAbout, "logical" | "logicalStrict" | "stylistic" | "stylisticStrict">

Preset lists of rules to enable on files.

@seehttps://flint.fyi/glossary#preset flint.fyi/glossary#preset

presets
.
logicalStrict: Rule<RuleAbout, object, object, string, AnyOptionalSchema | undefined>[]
logicalStrict
,
const md: Plugin<RuleAbout, "all", [Rule<{
readonly description: "Reports bare URLs that should be formatted as autolinks or links.";
readonly id: "bareUrls";
readonly presets: ["stylistic", "stylisticStrict"];
} & {
presets?: ("logical" | "logicalStrict" | "stylistic" | "stylisticStrict")[];
url: string;
}, object, object, "bareUrl", AnyOptionalSchema>, Rule<{
readonly description: "Reports definitions with empty URLs or only empty fragments.";
readonly id: "definitionContents";
readonly presets: ["logical"];
} & {
presets?: ("logical" | "logicalStrict" | "stylistic" | "stylisticStrict")[];
url: string;
}, object, object, "emptyDefinition", AnyOptionalSchema>, ... 13 more ..., Rule<...>]>
md
.
Plugin<RuleAbout, "all", [Rule<{ readonly description: "Reports bare URLs that should be formatted as autolinks or links."; readonly id: "bareUrls"; readonly presets: [...]; } & { ...; }, object, object, "bareUrl", AnyOptionalSchema>, ... 14 more ..., Rule<...>]>.presets: PluginPresets<RuleAbout, "logical" | "logicalStrict" | "stylistic" | "stylisticStrict">

Preset lists of rules to enable on files.

@seehttps://flint.fyi/glossary#preset flint.fyi/glossary#preset

presets
.
stylisticStrict: Rule<RuleAbout, object, object, string, AnyOptionalSchema | undefined>[]
stylisticStrict
],
},
],
});

Rules that find bugs and enforce good Markdown practices for most-to-all Markdown files.

flint.config.ts
import {
function defineConfig(definition: ConfigDefinition): Config

Defines a new linter configuration for a Flint config file.

@seehttps://flint.fyi/configuration flint.fyi/configuration

defineConfig
,
const md: Plugin<RuleAbout, "all", [Rule<{
readonly description: "Reports bare URLs that should be formatted as autolinks or links.";
readonly id: "bareUrls";
readonly presets: ["stylistic", "stylisticStrict"];
} & {
presets?: ("logical" | "logicalStrict" | "stylistic" | "stylisticStrict")[];
url: string;
}, object, object, "bareUrl", AnyOptionalSchema>, Rule<{
readonly description: "Reports definitions with empty URLs or only empty fragments.";
readonly id: "definitionContents";
readonly presets: ["logical"];
} & {
presets?: ("logical" | "logicalStrict" | "stylistic" | "stylisticStrict")[];
url: string;
}, object, object, "emptyDefinition", AnyOptionalSchema>, ... 13 more ..., Rule<...>]>
md
} from "flint";
export default
function defineConfig(definition: ConfigDefinition): Config

Defines a new linter configuration for a Flint config file.

@seehttps://flint.fyi/configuration flint.fyi/configuration

defineConfig
({
ConfigDefinition.use: ConfigUseDefinition[]

Specifies the files to be linted alongside the rules and settings to lint with.

@seehttps://flint.fyi/configuration#use flint.fyi/configuration#use

use
: [
{
ConfigUseDefinition.files: AnyLevelDeep<FilesValue>

A list of glob patterns describing which file(s) to lint.

@seehttps://flint.fyi/configuration#files flint.fyi/configuration#files

files
:
const md: Plugin<RuleAbout, "all", [Rule<{
readonly description: "Reports bare URLs that should be formatted as autolinks or links.";
readonly id: "bareUrls";
readonly presets: ["stylistic", "stylisticStrict"];
} & {
presets?: ("logical" | "logicalStrict" | "stylistic" | "stylisticStrict")[];
url: string;
}, object, object, "bareUrl", AnyOptionalSchema>, Rule<{
readonly description: "Reports definitions with empty URLs or only empty fragments.";
readonly id: "definitionContents";
readonly presets: ["logical"];
} & {
presets?: ("logical" | "logicalStrict" | "stylistic" | "stylisticStrict")[];
url: string;
}, object, object, "emptyDefinition", AnyOptionalSchema>, ... 13 more ..., Rule<...>]>
md
.
Plugin<RuleAbout, "all", [Rule<{ readonly description: "Reports bare URLs that should be formatted as autolinks or links."; readonly id: "bareUrls"; readonly presets: [...]; } & { ...; }, object, object, "bareUrl", AnyOptionalSchema>, ... 14 more ..., Rule<...>]>.files: Record<"all", FilesValue>

Selectors of files this plugin suggests applying its rules to.

@seehttps://flint.fyi/glossary#files flint.fyi/glossary#files

files
.
all: FilesValue
all
,
ConfigUseDefinition.rules: AnyLevelDeep<ConfigRuleDefinition>

Any number of rules and/or presets of rules to enable for those files.

@seehttps://flint.fyi/configuration#rules flint.fyi/configuration#rules

rules
:
const md: Plugin<RuleAbout, "all", [Rule<{
readonly description: "Reports bare URLs that should be formatted as autolinks or links.";
readonly id: "bareUrls";
readonly presets: ["stylistic", "stylisticStrict"];
} & {
presets?: ("logical" | "logicalStrict" | "stylistic" | "stylisticStrict")[];
url: string;
}, object, object, "bareUrl", AnyOptionalSchema>, Rule<{
readonly description: "Reports definitions with empty URLs or only empty fragments.";
readonly id: "definitionContents";
readonly presets: ["logical"];
} & {
presets?: ("logical" | "logicalStrict" | "stylistic" | "stylisticStrict")[];
url: string;
}, object, object, "emptyDefinition", AnyOptionalSchema>, ... 13 more ..., Rule<...>]>
md
.
Plugin<RuleAbout, "all", [Rule<{ readonly description: "Reports bare URLs that should be formatted as autolinks or links."; readonly id: "bareUrls"; readonly presets: [...]; } & { ...; }, object, object, "bareUrl", AnyOptionalSchema>, ... 14 more ..., Rule<...>]>.presets: PluginPresets<RuleAbout, "logical" | "logicalStrict" | "stylistic" | "stylisticStrict">

Preset lists of rules to enable on files.

@seehttps://flint.fyi/glossary#preset flint.fyi/glossary#preset

presets
.
logical: Rule<RuleAbout, object, object, string, AnyOptionalSchema | undefined>[]
logical
,
},
],
});

Additional logical rules that enforce best practices which are not always straightforward to implement. These rules are recommended for projects where a majority of developers are experienced with both Markdown and using a linter.

flint.config.ts
import {
function defineConfig(definition: ConfigDefinition): Config

Defines a new linter configuration for a Flint config file.

@seehttps://flint.fyi/configuration flint.fyi/configuration

defineConfig
,
const md: Plugin<RuleAbout, "all", [Rule<{
readonly description: "Reports bare URLs that should be formatted as autolinks or links.";
readonly id: "bareUrls";
readonly presets: ["stylistic", "stylisticStrict"];
} & {
presets?: ("logical" | "logicalStrict" | "stylistic" | "stylisticStrict")[];
url: string;
}, object, object, "bareUrl", AnyOptionalSchema>, Rule<{
readonly description: "Reports definitions with empty URLs or only empty fragments.";
readonly id: "definitionContents";
readonly presets: ["logical"];
} & {
presets?: ("logical" | "logicalStrict" | "stylistic" | "stylisticStrict")[];
url: string;
}, object, object, "emptyDefinition", AnyOptionalSchema>, ... 13 more ..., Rule<...>]>
md
} from "flint";
export default
function defineConfig(definition: ConfigDefinition): Config

Defines a new linter configuration for a Flint config file.

@seehttps://flint.fyi/configuration flint.fyi/configuration

defineConfig
({
ConfigDefinition.use: ConfigUseDefinition[]

Specifies the files to be linted alongside the rules and settings to lint with.

@seehttps://flint.fyi/configuration#use flint.fyi/configuration#use

use
: [
{
ConfigUseDefinition.files: AnyLevelDeep<FilesValue>

A list of glob patterns describing which file(s) to lint.

@seehttps://flint.fyi/configuration#files flint.fyi/configuration#files

files
:
const md: Plugin<RuleAbout, "all", [Rule<{
readonly description: "Reports bare URLs that should be formatted as autolinks or links.";
readonly id: "bareUrls";
readonly presets: ["stylistic", "stylisticStrict"];
} & {
presets?: ("logical" | "logicalStrict" | "stylistic" | "stylisticStrict")[];
url: string;
}, object, object, "bareUrl", AnyOptionalSchema>, Rule<{
readonly description: "Reports definitions with empty URLs or only empty fragments.";
readonly id: "definitionContents";
readonly presets: ["logical"];
} & {
presets?: ("logical" | "logicalStrict" | "stylistic" | "stylisticStrict")[];
url: string;
}, object, object, "emptyDefinition", AnyOptionalSchema>, ... 13 more ..., Rule<...>]>
md
.
Plugin<RuleAbout, "all", [Rule<{ readonly description: "Reports bare URLs that should be formatted as autolinks or links."; readonly id: "bareUrls"; readonly presets: [...]; } & { ...; }, object, object, "bareUrl", AnyOptionalSchema>, ... 14 more ..., Rule<...>]>.files: Record<"all", FilesValue>

Selectors of files this plugin suggests applying its rules to.

@seehttps://flint.fyi/glossary#files flint.fyi/glossary#files

files
.
all: FilesValue
all
,
ConfigUseDefinition.rules: AnyLevelDeep<ConfigRuleDefinition>

Any number of rules and/or presets of rules to enable for those files.

@seehttps://flint.fyi/configuration#rules flint.fyi/configuration#rules

rules
:
const md: Plugin<RuleAbout, "all", [Rule<{
readonly description: "Reports bare URLs that should be formatted as autolinks or links.";
readonly id: "bareUrls";
readonly presets: ["stylistic", "stylisticStrict"];
} & {
presets?: ("logical" | "logicalStrict" | "stylistic" | "stylisticStrict")[];
url: string;
}, object, object, "bareUrl", AnyOptionalSchema>, Rule<{
readonly description: "Reports definitions with empty URLs or only empty fragments.";
readonly id: "definitionContents";
readonly presets: ["logical"];
} & {
presets?: ("logical" | "logicalStrict" | "stylistic" | "stylisticStrict")[];
url: string;
}, object, object, "emptyDefinition", AnyOptionalSchema>, ... 13 more ..., Rule<...>]>
md
.
Plugin<RuleAbout, "all", [Rule<{ readonly description: "Reports bare URLs that should be formatted as autolinks or links."; readonly id: "bareUrls"; readonly presets: [...]; } & { ...; }, object, object, "bareUrl", AnyOptionalSchema>, ... 14 more ..., Rule<...>]>.presets: PluginPresets<RuleAbout, "logical" | "logicalStrict" | "stylistic" | "stylisticStrict">

Preset lists of rules to enable on files.

@seehttps://flint.fyi/glossary#preset flint.fyi/glossary#preset

presets
.
logicalStrict: Rule<RuleAbout, object, object, string, AnyOptionalSchema | undefined>[]
logicalStrict
,
},
],
});

This preset’s rules are a superset of those in logical.

Rules that enforce consistent styling and best stylistic practices for most-to-all Markdown files.

flint.config.ts
import {
function defineConfig(definition: ConfigDefinition): Config

Defines a new linter configuration for a Flint config file.

@seehttps://flint.fyi/configuration flint.fyi/configuration

defineConfig
,
const md: Plugin<RuleAbout, "all", [Rule<{
readonly description: "Reports bare URLs that should be formatted as autolinks or links.";
readonly id: "bareUrls";
readonly presets: ["stylistic", "stylisticStrict"];
} & {
presets?: ("logical" | "logicalStrict" | "stylistic" | "stylisticStrict")[];
url: string;
}, object, object, "bareUrl", AnyOptionalSchema>, Rule<{
readonly description: "Reports definitions with empty URLs or only empty fragments.";
readonly id: "definitionContents";
readonly presets: ["logical"];
} & {
presets?: ("logical" | "logicalStrict" | "stylistic" | "stylisticStrict")[];
url: string;
}, object, object, "emptyDefinition", AnyOptionalSchema>, ... 13 more ..., Rule<...>]>
md
} from "flint";
export default
function defineConfig(definition: ConfigDefinition): Config

Defines a new linter configuration for a Flint config file.

@seehttps://flint.fyi/configuration flint.fyi/configuration

defineConfig
({
ConfigDefinition.use: ConfigUseDefinition[]

Specifies the files to be linted alongside the rules and settings to lint with.

@seehttps://flint.fyi/configuration#use flint.fyi/configuration#use

use
: [
{
ConfigUseDefinition.files: AnyLevelDeep<FilesValue>

A list of glob patterns describing which file(s) to lint.

@seehttps://flint.fyi/configuration#files flint.fyi/configuration#files

files
:
const md: Plugin<RuleAbout, "all", [Rule<{
readonly description: "Reports bare URLs that should be formatted as autolinks or links.";
readonly id: "bareUrls";
readonly presets: ["stylistic", "stylisticStrict"];
} & {
presets?: ("logical" | "logicalStrict" | "stylistic" | "stylisticStrict")[];
url: string;
}, object, object, "bareUrl", AnyOptionalSchema>, Rule<{
readonly description: "Reports definitions with empty URLs or only empty fragments.";
readonly id: "definitionContents";
readonly presets: ["logical"];
} & {
presets?: ("logical" | "logicalStrict" | "stylistic" | "stylisticStrict")[];
url: string;
}, object, object, "emptyDefinition", AnyOptionalSchema>, ... 13 more ..., Rule<...>]>
md
.
Plugin<RuleAbout, "all", [Rule<{ readonly description: "Reports bare URLs that should be formatted as autolinks or links."; readonly id: "bareUrls"; readonly presets: [...]; } & { ...; }, object, object, "bareUrl", AnyOptionalSchema>, ... 14 more ..., Rule<...>]>.files: Record<"all", FilesValue>

Selectors of files this plugin suggests applying its rules to.

@seehttps://flint.fyi/glossary#files flint.fyi/glossary#files

files
.
all: FilesValue
all
,
ConfigUseDefinition.rules: AnyLevelDeep<ConfigRuleDefinition>

Any number of rules and/or presets of rules to enable for those files.

@seehttps://flint.fyi/configuration#rules flint.fyi/configuration#rules

rules
:
const md: Plugin<RuleAbout, "all", [Rule<{
readonly description: "Reports bare URLs that should be formatted as autolinks or links.";
readonly id: "bareUrls";
readonly presets: ["stylistic", "stylisticStrict"];
} & {
presets?: ("logical" | "logicalStrict" | "stylistic" | "stylisticStrict")[];
url: string;
}, object, object, "bareUrl", AnyOptionalSchema>, Rule<{
readonly description: "Reports definitions with empty URLs or only empty fragments.";
readonly id: "definitionContents";
readonly presets: ["logical"];
} & {
presets?: ("logical" | "logicalStrict" | "stylistic" | "stylisticStrict")[];
url: string;
}, object, object, "emptyDefinition", AnyOptionalSchema>, ... 13 more ..., Rule<...>]>
md
.
Plugin<RuleAbout, "all", [Rule<{ readonly description: "Reports bare URLs that should be formatted as autolinks or links."; readonly id: "bareUrls"; readonly presets: [...]; } & { ...; }, object, object, "bareUrl", AnyOptionalSchema>, ... 14 more ..., Rule<...>]>.presets: PluginPresets<RuleAbout, "logical" | "logicalStrict" | "stylistic" | "stylisticStrict">

Preset lists of rules to enable on files.

@seehttps://flint.fyi/glossary#preset flint.fyi/glossary#preset

presets
.
stylistic: Rule<RuleAbout, object, object, string, AnyOptionalSchema | undefined>[]
stylistic
,
},
],
});

Additional stylistic rules that enforce best practices which are not always straightforward to implement. These rules are recommended for projects where a majority of developers are experienced with both Markdown and using a linter.

flint.config.ts
import {
function defineConfig(definition: ConfigDefinition): Config

Defines a new linter configuration for a Flint config file.

@seehttps://flint.fyi/configuration flint.fyi/configuration

defineConfig
,
const md: Plugin<RuleAbout, "all", [Rule<{
readonly description: "Reports bare URLs that should be formatted as autolinks or links.";
readonly id: "bareUrls";
readonly presets: ["stylistic", "stylisticStrict"];
} & {
presets?: ("logical" | "logicalStrict" | "stylistic" | "stylisticStrict")[];
url: string;
}, object, object, "bareUrl", AnyOptionalSchema>, Rule<{
readonly description: "Reports definitions with empty URLs or only empty fragments.";
readonly id: "definitionContents";
readonly presets: ["logical"];
} & {
presets?: ("logical" | "logicalStrict" | "stylistic" | "stylisticStrict")[];
url: string;
}, object, object, "emptyDefinition", AnyOptionalSchema>, ... 13 more ..., Rule<...>]>
md
} from "flint";
export default
function defineConfig(definition: ConfigDefinition): Config

Defines a new linter configuration for a Flint config file.

@seehttps://flint.fyi/configuration flint.fyi/configuration

defineConfig
({
ConfigDefinition.use: ConfigUseDefinition[]

Specifies the files to be linted alongside the rules and settings to lint with.

@seehttps://flint.fyi/configuration#use flint.fyi/configuration#use

use
: [
{
ConfigUseDefinition.files: AnyLevelDeep<FilesValue>

A list of glob patterns describing which file(s) to lint.

@seehttps://flint.fyi/configuration#files flint.fyi/configuration#files

files
:
const md: Plugin<RuleAbout, "all", [Rule<{
readonly description: "Reports bare URLs that should be formatted as autolinks or links.";
readonly id: "bareUrls";
readonly presets: ["stylistic", "stylisticStrict"];
} & {
presets?: ("logical" | "logicalStrict" | "stylistic" | "stylisticStrict")[];
url: string;
}, object, object, "bareUrl", AnyOptionalSchema>, Rule<{
readonly description: "Reports definitions with empty URLs or only empty fragments.";
readonly id: "definitionContents";
readonly presets: ["logical"];
} & {
presets?: ("logical" | "logicalStrict" | "stylistic" | "stylisticStrict")[];
url: string;
}, object, object, "emptyDefinition", AnyOptionalSchema>, ... 13 more ..., Rule<...>]>
md
.
Plugin<RuleAbout, "all", [Rule<{ readonly description: "Reports bare URLs that should be formatted as autolinks or links."; readonly id: "bareUrls"; readonly presets: [...]; } & { ...; }, object, object, "bareUrl", AnyOptionalSchema>, ... 14 more ..., Rule<...>]>.files: Record<"all", FilesValue>

Selectors of files this plugin suggests applying its rules to.

@seehttps://flint.fyi/glossary#files flint.fyi/glossary#files

files
.
all: FilesValue
all
,
ConfigUseDefinition.rules: AnyLevelDeep<ConfigRuleDefinition>

Any number of rules and/or presets of rules to enable for those files.

@seehttps://flint.fyi/configuration#rules flint.fyi/configuration#rules

rules
:
const md: Plugin<RuleAbout, "all", [Rule<{
readonly description: "Reports bare URLs that should be formatted as autolinks or links.";
readonly id: "bareUrls";
readonly presets: ["stylistic", "stylisticStrict"];
} & {
presets?: ("logical" | "logicalStrict" | "stylistic" | "stylisticStrict")[];
url: string;
}, object, object, "bareUrl", AnyOptionalSchema>, Rule<{
readonly description: "Reports definitions with empty URLs or only empty fragments.";
readonly id: "definitionContents";
readonly presets: ["logical"];
} & {
presets?: ("logical" | "logicalStrict" | "stylistic" | "stylisticStrict")[];
url: string;
}, object, object, "emptyDefinition", AnyOptionalSchema>, ... 13 more ..., Rule<...>]>
md
.
Plugin<RuleAbout, "all", [Rule<{ readonly description: "Reports bare URLs that should be formatted as autolinks or links."; readonly id: "bareUrls"; readonly presets: [...]; } & { ...; }, object, object, "bareUrl", AnyOptionalSchema>, ... 14 more ..., Rule<...>]>.presets: PluginPresets<RuleAbout, "logical" | "logicalStrict" | "stylistic" | "stylisticStrict">

Preset lists of rules to enable on files.

@seehttps://flint.fyi/glossary#preset flint.fyi/glossary#preset

presets
.
stylisticStrict: Rule<RuleAbout, object, object, string, AnyOptionalSchema | undefined>[]
stylisticStrict
,
},
],
});

This preset’s rules are a superset of those in stylistic.

Implemented: 16 of 24 (66.6%)
Flint RulePreset
definitionContentsReports definitions with empty URLs or only empty fragments.logical
definitionDuplicatesReports duplicate definition identifiers (case-insensitive).logical
definitionUsesReports unused reference definitions.logical
headingIncrementsReports heading levels incrementing by more than one.logical
imageAltTextsReports images without alternative text.logical
imageContentsReports images with empty URLs or only empty fragments.logical
labelReferencesReports missing label references.logical
labelReferenceValidityReports invalid label references with whitespace.logical
linkContentsReports links with empty URLs or only empty fragments.logical
linkFragmentsReports link fragments that don't exist in the document.logical
referenceLikeUrlsReports resource links/images with URLs that match definition identifiers.logical
tableColumnCountsReports table rows with column counts that don't match the header.logical
headingRootDuplicatesReports multiple H1 headings in the same document.logical (strict)
headingRootPresencelogical (strict)
linkDescriptionslogical (strict)
codeSpacesstylistic
mediaSyntaxReversalsReports reversed link and image syntax in Markdown.stylistic
bareUrlsReports bare URLs that should be formatted as autolinks or links.stylistic (strict)
blockquoteBlankLineMultiplesstylistic (strict)
fencedCodeLanguagesReports fenced code blocks without a language specified.stylistic (strict)
headingDuplicatesstylistic (strict)
headingEmphasisEquivalentsstylistic (strict)
headingTrailingPunctuationstylistic (strict)
olPrefixesstylistic (strict)

Flint’s Markdown plugin provides the following file selector:

  • all: **/*.md
Made with ❤️‍🔥 around the world by the Flint team and contributors.