remark-lint-no-hidden-table-cell
raw JSON → 1.0.1 verified Fri May 01 auth: no javascript
remark-lint rule to warn for superfluous table cells that are hidden because a row has more cells than the header row. Current stable version: 1.0.1. Part of the remark-lint monorepo maintained by unified collective. Released in 2024. Supports GFM tables via remark-gfm. ESM-only, ships TypeScript types. Unlike general table linting, this rule specifically catches rows with extra cells that are not rendered.
Common errors
error Error [ERR_REQUIRE_ESM]: require() of ES Module ... not supported ↓
cause Using CommonJS require() to import an ESM-only module.
fix
Switch to import statement or use dynamic import().
error Could not parse table: unrecognized table row structure ↓
cause Missing remark-gfm plugin to parse GFM tables.
fix
Install remark-gfm and add .use(remarkGfm) to the pipeline.
error Cannot find module 'remark-lint' ↓
cause remark-lint is not installed in the project.
fix
Run npm install remark-lint.
Warnings
breaking ESM-only package: require() will throw ERR_REQUIRE_ESM. ↓
fix Use import instead of require. Set type: 'module' in package.json.
breaking Requires Node.js 16+ as of version 1. ↓
fix Upgrade Node.js to version 16 or later.
gotcha Does not work without remark-gfm for tables using GitHub Flavored Markdown. ↓
fix Install remark-gfm and add .use(remarkGfm) before linting.
gotcha The plugin has no options; attempting to pass options will be silently ignored. ↓
fix Do not pass any parameters. Use as .use(remarkLintNoHiddenTableCell).
Install
npm install remark-lint-no-hidden-table-cell yarn add remark-lint-no-hidden-table-cell pnpm add remark-lint-no-hidden-table-cell Imports
- remarkLintNoHiddenTableCell wrong
const { remarkLintNoHiddenTableCell } = require('remark-lint-no-hidden-table-cell')correctimport remarkLintNoHiddenTableCell from 'remark-lint-no-hidden-table-cell' - remarkLint wrong
import { remarkLint } from 'remark-lint'correctimport remarkLint from 'remark-lint' - remarkParse wrong
const remarkParse = require('remark-parse')correctimport remarkParse from 'remark-parse'
Quickstart
import remarkLint from 'remark-lint'
import remarkLintNoHiddenTableCell from 'remark-lint-no-hidden-table-cell'
import remarkParse from 'remark-parse'
import remarkStringify from 'remark-stringify'
import remarkGfm from 'remark-gfm'
import { read } from 'to-vfile'
import { unified } from 'unified'
import { reporter } from 'vfile-reporter'
const file = await read('example.md')
await unified()
.use(remarkParse)
.use(remarkGfm)
.use(remarkLint)
.use(remarkLintNoHiddenTableCell)
.use(remarkStringify)
.process(file)
console.error(reporter(file))