remark-lint-no-table-indentation
raw JSON → 5.0.1 verified Fri May 01 auth: no javascript
remark-lint rule to warn when GFM tables are indented. This package is part of the remark-lint ecosystem and checks that tables are not indented. It is ESM-only (requires Node.js 16+ and `remark-gfm` for GFM table support). The rule has no options and recommends no indentation for tables. It is included in the `remark-preset-lint-markdown-style-guide` preset. The plugin is a `Transformer` from unified. Current stable version is 5.0.1 released as part of the remark-lint monorepo. Release cadence is irregular, tied to the monorepo maintenance. Key differentiator: it only checks table indentation, making it lightweight and focused.
Common errors
error Cannot find module 'remark-lint-no-table-indentation' ↓
cause Package not installed or incorrect import path.
fix
Run
npm install remark-lint-no-table-indentation and ensure you are using ESM import. error SyntaxError: Unexpected token '?' ↓
cause Using CommonJS require with an ESM-only package.
fix
Use ESM with
import or import() dynamic import. Warnings
breaking Package is ESM-only. CommonJS require will throw an error. ↓
fix Convert to ESM with import syntax, or use dynamic import().
deprecated This rule is part of remark-lint and only works with unified's async transformer model. ↓
fix Ensure you use async/await or handle promises.
gotcha The rule requires remark-gfm to be used if you have GFM tables, otherwise no table AST nodes are generated. ↓
fix Install remark-gfm and add it to the unified pipeline before this rule.
gotcha The rule has no options. Misconfigured options are silently ignored. ↓
fix Do not pass any options; the rule accepts none.
Install
npm install remark-lint-no-table-indentation yarn add remark-lint-no-table-indentation pnpm add remark-lint-no-table-indentation Imports
- remarkLintNoTableIndentation wrong
const remarkLintNoTableIndentation = require('remark-lint-no-table-indentation')correctimport remarkLintNoTableIndentation from 'remark-lint-no-table-indentation'
Quickstart
import {unified} from 'unified'
import remarkParse from 'remark-parse'
import remarkStringify from 'remark-stringify'
import remarkLint from 'remark-lint'
import remarkLintNoTableIndentation from 'remark-lint-no-table-indentation'
import {reporter} from 'vfile-reporter'
const file = await unified()
.use(remarkParse)
.use(remarkLint)
.use(remarkLintNoTableIndentation)
.use(remarkStringify)
.process('# Hello\n\n | a | b |\n | - | - |\n | 1 | 2 |\n')
console.error(reporter(file))