{"_id":"markdownlint-rule-table-format","_rev":"4-c20cdfa7ed0df3459e57e97582f72529","name":"markdownlint-rule-table-format","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"markdownlint-rule-table-format","version":"1.0.0","keywords":["markdownlint-rule","markdownlint","markdown","table","MD060","format"],"license":"MIT","_id":"markdownlint-rule-table-format@1.0.0","maintainers":[{"name":"swirle13","email":"swirle13@gmail.com"}],"homepage":"https://github.com/swirle13/markdownlint-rule-table-format#readme","bugs":{"url":"https://github.com/swirle13/markdownlint-rule-table-format/issues"},"dist":{"shasum":"80ae7a205b0a3a9a51f5a6fcc8cc8c73b526cd78","tarball":"https://registry.npmjs.org/markdownlint-rule-table-format/-/markdownlint-rule-table-format-1.0.0.tgz","fileCount":4,"integrity":"sha512-C9wE4Pqdc9b9JwArw46W/q/h0TYkF8Ir/mklOu/eOZgvP6zIbLXOwng7wM5A/kfC/EHGUkgbOIsa36DnftPiQA==","signatures":[{"sig":"MEYCIQDCyDwupslquvuZmHOZunIauUpQ4YKd9QNXY6x3M4m8nwIhAN+BL1fzC8qQ6cmp9B5Y+fryLZicedFn28t1I6Ccpskv","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16868},"main":"rule.js","engines":{"node":">=16"},"gitHead":"f003425deb0ec9966c9e60abf7dc626fcefec1ba","private":false,"scripts":{"lint":"eslint rule.js","test":"node tests/rule-tests.js"},"_npmUser":{"name":"swirle13","email":"swirle13@gmail.com"},"repository":{"url":"git+https://github.com/swirle13/markdownlint-rule-table-format.git","type":"git"},"_npmVersion":"11.3.0","description":"A custom markdownlint rule to format GFM tables to comply with MD060 (aligned, compact, or tight style)","directories":{},"_nodeVersion":"24.2.0","_hasShrinkwrap":false,"devDependencies":{"markdownlint":"^0.30.0"},"_npmOperationalInternal":{"tmp":"tmp/markdownlint-rule-table-format_1.0.0_1772674639054_0.9235109019686116","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"markdownlint-rule-table-format","version":"1.0.1","keywords":["markdownlint-rule","markdownlint","markdown","table","MD060","format"],"license":"MIT","_id":"markdownlint-rule-table-format@1.0.1","maintainers":[{"name":"swirle13","email":"swirle13@gmail.com"}],"homepage":"https://github.com/swirle13/markdownlint-rule-table-format#readme","bugs":{"url":"https://github.com/swirle13/markdownlint-rule-table-format/issues"},"dist":{"shasum":"c880b87a657c3518ce2d137a6bc8c7059f84595b","tarball":"https://registry.npmjs.org/markdownlint-rule-table-format/-/markdownlint-rule-table-format-1.0.1.tgz","fileCount":4,"integrity":"sha512-u5AQ8S/wWEpdiARFwAkKu5NExUrbsvbWg3FPfElUExrxm6LpFoQF/HaqC2PQeu+0YiXvQ+Y6oSDXvjbc5g8FvA==","signatures":[{"sig":"MEUCIEjq7tnfshXb49XiBUHDZMH6ZjEAlRzdMwmI646WfV99AiEAt/Gv0Bid3OaWYrBmcoOHTxnScfEX4oQ/er6q3YghH60=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16868},"main":"rule.js","engines":{"node":">=16"},"gitHead":"46f3b8bf35f7ded633ebe683d279f0081449f00d","private":false,"scripts":{"lint":"eslint rule.js","test":"node tests/rule-tests.js"},"_npmUser":{"name":"swirle13","email":"swirle13@gmail.com"},"repository":{"url":"git+https://github.com/swirle13/markdownlint-rule-table-format.git","type":"git"},"_npmVersion":"11.3.0","description":"A custom markdownlint rule to format GFM tables to comply with MD060 (aligned, compact, or tight style)","directories":{},"_nodeVersion":"24.2.0","_hasShrinkwrap":false,"devDependencies":{"markdownlint":"^0.40.0"},"_npmOperationalInternal":{"tmp":"tmp/markdownlint-rule-table-format_1.0.1_1772674911764_0.9600011592839508","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"markdownlint-rule-table-format","version":"1.0.2","keywords":["markdownlint-rule","markdownlint","markdown","table","MD060","format"],"license":"MIT","_id":"markdownlint-rule-table-format@1.0.2","maintainers":[{"name":"swirle13","email":"swirle13@gmail.com"}],"homepage":"https://github.com/swirle13/markdownlint-rule-table-format#readme","bugs":{"url":"https://github.com/swirle13/markdownlint-rule-table-format/issues"},"dist":{"shasum":"9f53097087c438ec8a8f77f183dc57f68d8e36b3","tarball":"https://registry.npmjs.org/markdownlint-rule-table-format/-/markdownlint-rule-table-format-1.0.2.tgz","fileCount":4,"integrity":"sha512-w3c9va/5hzEucd8N/0vS0DlMRy04NnZhHYa7JZiJxSstzvmy6qae2RirxGKpxmY79vvSxZr5jndSwT1hFoRVOw==","signatures":[{"sig":"MEQCICwXsAMfGKZu36cnqGz0ogTWSVLY53K0FonvQUtt6yX9AiBFvFWZILjxKcXimulokbUtcxfwqX7yTommgteRhJnimA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":17480},"main":"rule.js","engines":{"node":">=16"},"gitHead":"c54f449231b4f6473cb510afc9d2a33b98f8ec33","private":false,"scripts":{"lint":"eslint rule.js","test":"node tests/rule-tests.js"},"_npmUser":{"name":"swirle13","email":"swirle13@gmail.com"},"repository":{"url":"git+https://github.com/swirle13/markdownlint-rule-table-format.git","type":"git"},"_npmVersion":"11.3.0","description":"A custom markdownlint rule to format GFM tables to comply with MD060 (aligned, compact, or tight style)","directories":{},"_nodeVersion":"24.2.0","_hasShrinkwrap":false,"devDependencies":{"markdownlint":"^0.40.0"},"_npmOperationalInternal":{"tmp":"tmp/markdownlint-rule-table-format_1.0.2_1773262567367_0.0400214649036994","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"markdownlint-rule-table-format","version":"1.0.3","description":"A custom markdownlint rule to format GFM tables to comply with MD060 (aligned, compact, or tight style)","main":"rule.js","license":"MIT","homepage":"https://github.com/swirle13/markdownlint-rule-table-format#readme","repository":{"type":"git","url":"git+https://github.com/swirle13/markdownlint-rule-table-format.git"},"bugs":{"url":"https://github.com/swirle13/markdownlint-rule-table-format/issues"},"keywords":["markdownlint-rule","markdownlint","markdown","table","MD060","format"],"private":false,"scripts":{"test":"node tests/rule-tests.js","lint":"eslint rule.js"},"engines":{"node":">=16"},"devDependencies":{"markdownlint":"^0.40.0"},"_id":"markdownlint-rule-table-format@1.0.3","gitHead":"b88265466097d70c334eea37ec30d9c9e52feba5","_nodeVersion":"24.2.0","_npmVersion":"11.3.0","dist":{"integrity":"sha512-ynK1E7k5XR67LbjPDuVdvFOZhGMDK8WFw1cgNt8kdBUwP+7mMLJqY4of3WFhx02rDnXfFWyDZy2wj25w8kSukA==","shasum":"e7807563fc700d454610d3fb00925beedad08029","tarball":"https://registry.npmjs.org/markdownlint-rule-table-format/-/markdownlint-rule-table-format-1.0.3.tgz","fileCount":4,"unpackedSize":17496,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBXSr8mvaJ1cs3VDGR0UeKg4NDqwI4ykZbkaa7WD26y0AiEAtYM//fI3XYIKeIaht60aXbID8xSesRt3SwiHuvvq+D4="}]},"_npmUser":{"name":"swirle13","email":"swirle13@gmail.com"},"directories":{},"maintainers":[{"name":"swirle13","email":"swirle13@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/markdownlint-rule-table-format_1.0.3_1776118411829_0.4684027936997135"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-05T01:37:19.053Z","modified":"2026-04-13T22:13:32.078Z","1.0.0":"2026-03-05T01:37:19.194Z","1.0.1":"2026-03-05T01:41:51.912Z","1.0.2":"2026-03-11T20:56:07.505Z","1.0.3":"2026-04-13T22:13:31.969Z"},"bugs":{"url":"https://github.com/swirle13/markdownlint-rule-table-format/issues"},"license":"MIT","homepage":"https://github.com/swirle13/markdownlint-rule-table-format#readme","keywords":["markdownlint-rule","markdownlint","markdown","table","MD060","format"],"repository":{"type":"git","url":"git+https://github.com/swirle13/markdownlint-rule-table-format.git"},"description":"A custom markdownlint rule to format GFM tables to comply with MD060 (aligned, compact, or tight style)","maintainers":[{"name":"swirle13","email":"swirle13@gmail.com"}],"readme":"# markdownlint-rule-table-format\n\nA custom [markdownlint](https://github.com/DavidAnson/markdownlint) rule to format GitHub Flavored Markdown (GFM) tables to comply with [MD060 (table-column-style)](https://github.com/DavidAnson/markdownlint/blob/main/doc/md060.md).\n\nInspired by [markdownlint-rule-search-replace](https://github.com/OnkarRuikar/markdownlint-rule-search-replace).\n\n## Overview\n\nThe built-in MD060 rule reports when table column style is inconsistent but does not auto-fix. This rule detects GFM tables and reformats them to one of the MD060 styles (**aligned**, **compact**, or **tight**), with optional fix application when using `markdownlint --fix`.\n\n- **aligned**: Pipes vertically aligned with padding (e.g. `| foo   | bar   |`).\n- **compact**: Single space around cell content (e.g. `| foo | bar |`); optional aligned delimiter row.\n- **tight**: No padding (e.g. `|foo|bar|`).\n\n## Installation\n\n```bash\nnpm install markdownlint-rule-table-format --save-dev\n```\n\n## Configuration\n\nAdd the rule and config to your markdownlint config (e.g. `.markdownlint.json` or `.markdownlint-cli2.jsonc`).\n\n### Using .markdownlint.json\n\n```json\n{\n  \"default\": true,\n  \"table-format\": {\n    \"style\": \"tight\",\n    \"aligned_delimiter\": true\n  }\n}\n```\n\nOr with markdownlint-cli2 and customRules:\n\n```json\n{\n  \"fix\": true,\n  \"customRules\": [\"markdownlint-rule-table-format\"],\n  \"config\": {\n    \"table-format\": {\n      \"style\": \"tight\",\n      \"aligned_delimiter\": true\n    }\n  }\n}\n```\n\n### Configuration options\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `style` | `\"aligned\"` \\| `\"compact\"` \\| `\"tight\"` \\| `\"any\"` | `\"aligned\"` | Target table style. Use `\"any\"` to disable the rule. |\n| `aligned_delimiter` | boolean | `false` | When `true`, the delimiter row aligns with the header (for compact/tight). |\n| `fix` | boolean | `true` | When `false`, only report violations (no fixInfo). |\n| `fixApplicator` | boolean | `true` | When `false`, only report violations (no fixInfo). |\n\nRule name aliases: `table-format` (recommended) or `table-column-style-fix`.\n\n## Usage\n\n### With markdownlint-cli\n\n```bash\nmarkdownlint README.md -r markdownlint-rule-table-format\n# or with fix\nmarkdownlint README.md -r markdownlint-rule-table-format --fix\n```\n\n### With markdownlint-cli2\n\n```bash\nmarkdownlint-cli2 \"**/*.md\" -c .markdownlint-cli2.jsonc\n# fix is applied when config has \"fix\": true\n```\n\n### With markdownlint API\n\n```js\nconst markdownlint = require(\"markdownlint\");\nconst tableFormat = require(\"markdownlint-rule-table-format\");\n\nconst options = {\n  files: [\"docs/**/*.md\"],\n  config: {\n    default: true,\n    \"table-format\": {\n      style: \"tight\",\n      aligned_delimiter: true,\n    },\n  },\n  customRules: [tableFormat],\n};\n\nmarkdownlint(options, (err, result) => {\n  if (!err) console.log(result.toString());\n});\n```\n\n## Disable for a section\n\n```md\n<!-- markdownlint-disable table-format -->\n\n| A | B |\n| - | - |\n| 1 | 2 |\n\n<!-- markdownlint-enable table-format -->\n```\n\n## References\n\n- [MD060 - Table column style](https://github.com/DavidAnson/markdownlint/blob/main/doc/md060.md)\n- [markdownlint Custom Rules](https://github.com/DavidAnson/markdownlint/blob/main/doc/CustomRules.md)\n- [markdownlint-rule-search-replace](https://github.com/OnkarRuikar/markdownlint-rule-search-replace) (template)\n\n## License\n\nMIT\n","readmeFilename":"README.md"}