Skip to content
NewBun 1.4.5 is out. Release notes
AphrodyBun

Linter · Rules

markdown/table-column-count

Disallow data rows in a table from having more cells than the header row

The header row decides how many columns a table has. Extra cells are dropped when the table is rendered, so their content is silently lost.

Tables are part of GitHub Flavored Markdown, so the rule reports nothing in markdown/commonmark.

Configure

Off by default. It needs an ESLint config that says which files are in the language:

eslint.config.js
import markdown from "@eslint/markdown";

export default [
  {
    files: ["**/*.md"],
    plugins: { markdown },
    language: "markdown/gfm",
    rules: { "markdown/table-column-count": "error" },
  },
];

It also works with markdown/commonmark.

Examples

Reported:

| Name | Port |
| ---- | ---- |
| api  | 3000 | internal |

Not reported:

| Name | Port |
| ---- | ---- |
| api  | 3000 |
| web  |

Options

OptionDefaultWhat it does
checkMissingCellsfalseAlso report a row with fewer cells than the header row.
| Name | Port |
| ---- | ---- |
| web  |