Registry / testing / remark-lint-checkbox-character-style

remark-lint-checkbox-character-style

JSON →
library5.0.1jsnpmunverified

ESM-only remark-lint rule (v5.0.1) that enforces consistent checkbox characters in GFM task list items. Checks that checked boxes use 'X' or 'x' and unchecked boxes use a space or tab, with options for 'consistent', 'space', 'tab', 'X', or 'x'. Ships TypeScript types. Stable with regular releases as part of the remark-lint monorepo. Differentiates from other lint rules by focusing solely on checkbox character style.

npm install remark-lint-checkbox-character-style
INSTALL
IMPORT
SIG · REMARK-LINT-CHECKB
R
remark-lint-checkbox-character-style
testingjavascriptv5.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import remarkLintCheckboxCharacterStyle from 'remark-lint-checkbox-character-style'
const remarkLintCheckboxCharacterStyle = require('remark-lint-checkbox-character-style')
ESM-only since v5; CJS require will fail or throw.
remarkLintCheckboxCharacterStyle
import remarkLintCheckboxCharacterStyle from 'remark-lint-checkbox-character-style'
import { remarkLintCheckboxCharacterStyle } from 'remark-lint-checkbox-character-style'
The package has no named exports; default import is required.
Options
import type { Options } from 'remark-lint-checkbox-character-style'
import { Options } from 'remark-lint-checkbox-character-style'
Only usable as TypeScript type; use with `import type`.

Shows unified integration with remark-lint-checkbox-character-style, enforcing checked='X' and unchecked space.

import { unified } from 'unified' import remarkParse from 'remark-parse' import remarkStringify from 'remark-stringify' import remarkLint from 'remark-lint' import remarkLintCheckboxCharacterStyle from 'remark-lint-checkbox-character-style' const file = await unified() .use(remarkParse) .use(remarkLint) .use(remarkLintCheckboxCharacterStyle, { checked: 'X', unchecked: ' ' }) // enforce 'X' and space .use(remarkStringify) .process('- [x] done\n- [ ] todo\n- [X] also done') console.log(String(file)) // No warning because 'x' and 'X' are mixed; 'x' is invalid. Warnings emitted via vfile-reporter. // To see warnings: import { reporter } from 'vfile-reporter' and console.error(reporter(file))
Debug
Known issues
breakingPackage is ESM-only since v5; CommonJS require() throws.
fix
Use ESM imports (import/default) or upgrade to Node 16+.
affects: >=5.0.0
breakingNo default export named 'remarkLintCheckboxCharacterStyle' as a named export; must default import.
fix
Use `import remarkLintCheckboxCharacterStyle from ...` not `import { ... }`.
affects: >=3.0.0
deprecatedOld style options may break; 'consistent' is default but behavior changed in v3 to detect first occurrence.
fix
Use explicit object syntax `{ checked: 'X', unchecked: ' ' }` or `'consistent'`.
affects: <3.0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module
Using CommonJS require with an ESM-only package (v5+).
fix
Switch to ESM imports or use dynamic import().
SyntaxError: The requested module 'remark-lint-checkbox-character-style' does not provide an export named 'remarkLintCheckboxCharacterStyle'
Named import used but package only has a default export.
fix
Use default import: import remarkLintCheckboxCharacterStyle from 'remark-lint-checkbox-character-style'
Upgrade
Version history
5.0.1latest on npm
Audit
Dependencies
remark-lintrequiredRequired to use any rule; linting framework
unifiedrequiredCore processing pipeline; required by remark-lint
Agent activity
4 hits · last 30 days
node
4
Resources