remark-lint-table-pipes

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

A remark-lint rule that warns when GFM table rows lack initial or final pipe delimiters. Current stable version is 5.0.1. This is an ESM-only package for Node.js 16+. It is part of the remark-lint ecosystem and included in the markdown-style-guide preset. Unlike other table lint rules that check alignment or cell padding, this rule specifically enforces that every row starts and ends with a pipe character, which is recommended by the markdown style guide and automatically fixed by remark-stringify.

error Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/remark-lint-table-pipes/index.js from /path/to/your/file.js not supported.
cause Package is ESM-only and cannot be imported via require().
fix
Change to import statement: import remarkLintTablePipes from 'remark-lint-table-pipes'
error SyntaxError: The requested module 'remark-lint-table-pipes' does not provide an export named 'remarkLintTablePipes'
cause Trying to use a named import from a package that only has a default export.
fix
Use default import: import remarkLintTablePipes from 'remark-lint-table-pipes'
error TypeError: remarkLintTablePipes is not a function
cause The imported value is not the plugin but an object with a default property (common when mixing CJS/ESM).
fix
Use default import: import remarkLintTablePipes from 'remark-lint-table-pipes' (not require).
breaking Package is ESM-only since v3.0.0. require() will not work.
fix Use import syntax or dynamic import(). If you must use CommonJS, pin to version 2.x.
breaking The rule now checks both opening and closing pipes. Previous versions only checked closing pipes.
fix If you previously relied on the rule ignoring missing opening pipes, update your markdown to include pipes at both ends of each row.
deprecated The option 'start' and 'end' have been removed. Now the rule always checks both.
fix Remove any configuration that passes options; the rule no longer accepts options.
gotcha The rule only works if remark-gfm is loaded before remark-lint-table-pipes in the unified pipeline.
fix Ensure you use .use(remarkGfm) before .use(remarkLintTablePipes).
gotcha Tables without header separators (e.g., only one row) are not detected as tables by remark-gfm, so the rule will not warn.
fix Always include a header separator row for tables to be parsed correctly.
npm install remark-lint-table-pipes
yarn add remark-lint-table-pipes
pnpm add remark-lint-table-pipes

Shows how to use the remark-lint-table-pipes rule programmatically with unified.

import { unified } from 'unified';
import remarkParse from 'remark-parse';
import remarkStringify from 'remark-stringify';
import remarkLint from 'remark-lint';
import remarkLintTablePipes from 'remark-lint-table-pipes';
import { read } from 'to-vfile';
import { reporter } from 'vfile-reporter';

const file = await read('example.md');

await unified()
  .use(remarkParse)
  .use(remarkLint)
  .use(remarkLintTablePipes)
  .use(remarkStringify)
  .process(file);

console.error(reporter(file));