remark-lint-checkbox-content-indent

raw JSON →
5.0.1 verified Fri May 01 auth: no javascript

remark-lint rule to warn when GFM tasklist checkboxes are followed by more than one space. Current stable version is 5.0.1 (as of early 2025), part of the remark-lint ecosystem. Unlike general Markdown linters, this rule is narrowly scoped to enforce consistent indentation after `[ ]` or `[x]` in task list items. It is ESM-only, ships TypeScript types, and integrates with remark's unified pipeline and CLI. No options. Alternatives like markdownlint have similar rules but remark-lint rules are composable with the remark ecosystem.

error Cannot find module 'remark-lint-checkbox-content-indent'
cause Package not installed or misconfigured in Node.js (especially with ESM imports)
fix
Run 'npm install remark-lint-checkbox-content-indent' and ensure package.json has 'type': 'module' or use .mjs extension.
error Cannot use import statement outside a module
cause Trying to use ESM import in a CommonJS context
fix
Add 'type': 'module' to package.json or use .mjs file extension.
breaking Package is ESM-only; no CommonJS support
fix Use import syntax or dynamic import, or use a CJS bundler transformation.
gotcha Requires remark-gfm to parse task lists; without it, rule does not apply
fix Install remark-gfm and add .use(remarkGfm) before .use(remarkLintCheckboxContentIndent)
gotcha Rule has no options; all configuration must be done via remark-lint's options mechanism
fix Pass options to remark-lint plugin, not directly to this rule.
deprecated None at this time
npm install remark-lint-checkbox-content-indent
yarn add remark-lint-checkbox-content-indent
pnpm add remark-lint-checkbox-content-indent

Lints a Markdown string for excessive whitespace after GFM tasklist checkboxes using remark. Shows how to set up unified pipeline with GFM support, lint rule, and report messages.

import { unified } from 'unified';
import remarkParse from 'remark-parse';
import remarkStringify from 'remark-stringify';
import remarkLint from 'remark-lint';
import remarkLintCheckboxContentIndent from 'remark-lint-checkbox-content-indent';
import remarkGfm from 'remark-gfm';
import { reporter } from 'vfile-reporter';

const file = await unified()
  .use(remarkParse)
  .use(remarkGfm)
  .use(remarkLint)
  .use(remarkLintCheckboxContentIndent)
  .use(remarkStringify)
  .process('- [x]  Too many spaces after checkbox\n');

console.error(reporter(file));
// Output: 1:8: Unexpected `2` spaces between checkbox and content, expected `1` space, remove `1` space