TFT

Markdown Linter and Code Beautifier

Clean and standardize your Markdown files. This linter identifies style issues and can automatically fix them according to configurable rules. Ensure consistency across your documentation.

Markdown Linter & Formatter

Check and fix common Markdown issues

How it works

This tool analyzes your Markdown files for style issues and formatting inconsistencies. It checks against a set of configurable rules and can automatically fix many common problems.

The linter parses your Markdown and checks for issues like inconsistent heading styles, trailing whitespace, improper list formatting, line length violations, and more. It reports each issue with its location and can apply fixes automatically.

Common rules checked:

  • Consistent heading style (ATX # vs setid ===)
  • No trailing whitespace at line ends
  • Consistent list marker style (- vs *)
  • Maximum line length (typically 80-120 characters)
  • Proper spacing around emphasis (**bold** not ** bold **)
  • Single blank line between sections

Run the linter to see issues listed with line numbers. Apply automatic fixes for common problems, then manually review any remaining warnings that need human judgment.

When you'd actually use this

Enforcing team documentation standards

A team has a style guide for Markdown docs. They run the linter on all contributions to ensure consistent formatting across the documentation, regardless of who wrote it.

Cleaning up legacy documentation

Someone inherits a docs repo with inconsistent formatting from multiple authors over years. They run the linter with auto-fix to standardize everything before taking over maintenance.

Pre-commit checks for Markdown files

A developer sets up the linter as a pre-commit hook. Before any Markdown changes are committed, the linter runs automatically, catching formatting issues before they reach the repo.

Preparing docs for open source release

Before open-sourcing internal docs, a team runs the linter to ensure professional, consistent formatting. Clean docs make a better first impression on potential contributors.

Learning Markdown best practices

A junior developer writes docs and runs the linter to learn what issues it finds. The warnings teach them proper Markdown style through practical feedback on their writing.

Maintaining large documentation sets

A tech writer manages hundreds of Markdown files. The linter helps them maintain consistency across the entire set, catching formatting drift that happens over time with many edits.

What to know before using it

Not all rules apply to every project.Some rules are opinionated. Line length limits, heading styles, and list markers are matters of preference. Configure rules to match your project's style guide.

Auto-fix can change intended formatting.Automatic fixes are safe for mechanical issues (trailing spaces, spacing around emphasis) but review changes. Some "issues" may be intentional stylistic choices.

Some issues require manual fixes.The linter can't fix everything automatically. Content issues, structural problems, and ambiguous cases need human judgment. Use the linter report as a checklist for manual review.

Different linters have different rules.markdownlint, remark-lint, and other tools have different default rules. This tool provides common rules, but may differ from what your CI/CD pipeline expects.

Pro tip: Create a configuration file for your project that specifies which rules to enable/disable. This ensures consistent linting across all contributors and CI runs.

Common questions

What's the difference between linting and formatting?

Linting finds issues; formatting fixes them. This tool does both: it identifies problems and can automatically fix mechanical issues. Some tools separate these functions, but they work well together.

Can I disable specific rules?

Yes, most linters allow rule configuration. Disable rules that don't fit your style. You can also disable rules for specific lines or sections using comments in your Markdown.

Does this work with GitHub Flavored Markdown?

Yes, modern linters support GFM extensions like tables, task lists, and strikethrough. Rules account for these features when checking formatting.

How do I integrate this into my workflow?

Use it as a pre-commit hook, in CI/CD pipelines, or as part of your editor setup. Many editors have Markdown linting extensions that show issues as you write.

Can I lint multiple files at once?

This tool handles one file at a time. For batch linting, use command-line linters like markdownlint-cli that can process entire directories and output summary reports.

What about front matter?

Most linters skip YAML front matter by default, as it has its own syntax rules. Some linters have separate rules for front matter validation if needed.

Does linting affect content meaning?

No. Linting only affects formatting and style, not content meaning. Proper linting makes your Markdown cleaner without changing what it says or how it renders.

Should I fix every warning?

Fix style violations for consistency. Some warnings are suggestions, not errors. Prioritize fixes that improve readability and match your team's agreed-upon style.