Registry / testing / remark-lint-table-pipe-alignment

remark-lint-table-pipe-alignment

JSON →
library4.1.1jsnpmunverified

A remark-lint rule that warns when GFM table cell dividers (pipes) are not aligned consistently. Current stable version is 4.1.1. This package is part of the remark-lint monorepo, which releases updates across all packages simultaneously. It enforces table formatting consistency, complementing other remark-lint table rules like remark-lint-table-cell-padding. Supports custom string length detection function for CJK/emoji characters. ESM-only, requires Node.js 16+.

npm install remark-lint-table-pipe-alignment
INSTALL
IMPORT
SIG · REMARK-LINT-TABLE-
R
remark-lint-table-pipe-alignment
testingjavascriptv4.1.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.

remarkLintTablePipeAlignment (default)
import remarkLintTablePipeAlignment from 'remark-lint-table-pipe-alignment'
const remarkLintTablePipeAlignment = require('remark-lint-table-pipe-alignment')
ESM-only package, cannot use require(). Use import.
Options (type)
import type { Options } from 'remark-lint-table-pipe-alignment'
import { Options } from 'remark-lint-table-pipe-alignment'
Options is a TypeScript type, not a runtime export. Use 'import type'.
Plugin usage with unified
unified().use(remarkLint).use(remarkLintTablePipeAlignment, { stringLength: (s) => s.length })
unified().use(remarkLintTablePipeAlignment, { stringLength: (s) => s.length })
Must use remarkLint first as a plugin before adding lint rules.

Uses unified pipeline to parse Markdown, lint table pipe alignment, stringify, and report warnings.

import { unified } from 'unified'; import remarkParse from 'remark-parse'; import remarkStringify from 'remark-stringify'; import remarkLint from 'remark-lint'; import remarkLintTablePipeAlignment from 'remark-lint-table-pipe-alignment'; import { read } from 'to-vfile'; import { reporter } from 'vfile-reporter'; const file = await read('example.md'); await unified() .use(remarkParse) .use(remarkLint) .use(remarkLintTablePipeAlignment) .use(remarkStringify) .process(file); console.error(reporter(file));
remark --version
Debug
Known issues
breakingPackage is ESM-only since v4. Requires Node.js 16+ and 'import' syntax.
fix
Use ES module imports (import ... from 'remark-lint-table-pipe-alignment') instead of require().
affects: >=4.0.0
deprecatedOlder versions (v3.x) still support CommonJS but are no longer maintained.
fix
Upgrade to v4+ and switch to ESM.
affects: >=3.0.0 <4.0.0
gotchaThe rule depends on remark-gfm to parse GFM tables; without it, it may not work as expected.
fix
Install remark-gfm and add .use(remarkGfm) before lint rules in the unified pipeline.
affects: >=1.0.0
gotchaThe 'stringLength' option must handle all characters; CJK/emoji may be misaligned without custom length detection.
fix
Provide a function that measures display width, e.g., using the 'string-width' package.
affects: >=4.1.0
Errors
Common errors & fixes
Cannot find module 'remark-lint-table-pipe-alignment'
Using require() in an ESM-only package or missing npm install.
fix
Run 'npm install remark-lint-table-pipe-alignment' and use import syntax.
Error: Cannot use import statement outside a module
Running the package without 'type': 'module' in package.json or without .mjs extension.
fix
Add "type": "module" to package.json or rename file to .mjs.
TypeError: remarkLintTablePipeAlignment is not a function
Importing the package incorrectly (e.g., const x = require('...') breaks ESM).
fix
Use 'import remarkLintTablePipeAlignment from 'remark-lint-table-pipe-alignment''.
Upgrade
Version history
4.1.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
remark-lint-table-pipe-alignment — npm install remark-lint-table-pipe-alignment · libregistry