About
Flint’s Markdown plugin supports linting .md
source code.
It comes provided with the flint
npm package.
Presets
Section titled “Presets”Flint’s Markdown plugin provides the following presets:
Preset | Recommended | Description |
---|---|---|
logical | ✅ Always | Common rules for finding bugs and enforcing good logical practices in Markdown files. |
logicalStrict | ☑️ When Ready | Additional rules for finding bugs and enforcing good logical practices in Markdown files. |
stylistic | ✅ Always | Common rules for consistent styling and best stylistic practices in Markdown files. |
stylisticStrict | ☑️ When Ready | Additional 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:
import { defineConfig, md } from "flint";
export default defineConfig({ use: [ { files: md.files.all, rules: [md.presets.logical, md.presets.stylistic], }, ],});
If you are experienced with both Markdown and linting, Flint recommends using the logicalStrict
and stylisticStrict
presets:
import { defineConfig, md } from "flint";
export default defineConfig({ use: [ { files: md.files.all, rules: [md.presets.logicalStrict, md.presets.stylisticStrict], }, ],});
logical
Section titled “logical”Rules that find bugs and enforce good Markdown practices for most-to-all Markdown files.
import { defineConfig, md } from "flint";
export default defineConfig({ use: [ { files: md.files.all, rules: md.presets.logical, }, ],});
logicalStrict
Section titled “logicalStrict”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.
import { defineConfig, md } from "flint";
export default defineConfig({ use: [ { files: md.files.all, rules: md.presets.logicalStrict, }, ],});
This preset’s rules are a superset of those in logical
.
stylistic
Section titled “stylistic”Rules that enforce consistent styling and best stylistic practices for most-to-all Markdown files.
import { defineConfig, md } from "flint";
export default defineConfig({ use: [ { files: md.files.all, rules: md.presets.stylistic, }, ],});
stylisticStrict
Section titled “stylisticStrict”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.
import { defineConfig, md } from "flint";
export default defineConfig({ use: [ { files: md.files.all, rules: md.presets.stylisticStrict, }, ],});
This preset’s rules are a superset of those in stylistic
.
Implemented: 5 of 17 (29.4%)
Flint Name | Preset | Biome Rule(s) | Deno Lint Rule(s) | ESLint Rule(s) | Oxlint Rule(s) |
---|---|---|---|---|---|
definitionContents | Logical | markdown/no-empty-definitions | |||
definitionDuplicates | Logical | markdown/no-duplicate-definitions | |||
definitionUses | Logical | markdown/no-unused-definitions | |||
headingIncrements | Logical | markdown/heading-increment | |||
imageAltTexts | Logical | markdown/require-alt-text | |||
imageContents | Logical | markdown/no-empty-images | |||
labelReferences | Logical | markdown/no-missing-label-refs | |||
labelReferenceValidity | Logical | markdown/no-invalid-label-refs | |||
linkContents | Logical | markdown/no-empty-links | |||
linkFragments | Logical | markdown/no-missing-link-fragments | |||
referenceLikeUrls | Logical | markdown/no-reference-like-url | |||
tableColumnCounts | Logical | markdown/table-column-count | |||
headingsRootDuplicates | Logical (Strict) | markdown/no-multiple-h1 | |||
mediaSyntaxReversals | Stylistic | markdown/no-reversed-media-syntax | |||
bareUrls | Stylistic (Strict) | markdown/no-bare-urls | |||
fencedCodeLanguages | Stylistic (Strict) | markdown/fenced-code-language | |||
headingDuplicates | Stylistic (Strict) | markdown/no-duplicate-headings |
Selectors
Section titled “Selectors”Flint’s Markdown plugin provides the following file selector:
all
:**/*.md