{"id":26485,"library":"tldr-lint","title":"tldr-lint","description":"A linting tool for validating and formatting tldr pages. Version 0.0.22 (stable) is actively maintained with frequent releases. It checks against 30+ rules (TLDR001–TLDR109) covering formatting, capitalization, punctuation, and structure. Unlike generic markdown linters, it is purpose-built for the tldr page format and includes an auto-format option (-f). Requires Node >=22, supports CLI use, Docker, and programmatic API.","status":"active","version":"0.0.22","language":"javascript","source_language":"en","source_url":"https://github.com/tldr-pages/tldr-lint","tags":["javascript","tldr","pages","lint","validate","format","linter"],"install":[{"cmd":"npm install tldr-lint","lang":"bash","label":"npm"},{"cmd":"yarn add tldr-lint","lang":"bash","label":"yarn"},{"cmd":"pnpm add tldr-lint","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"CLI argument parsing","package":"commander","optional":false}],"imports":[{"note":"ESM-only since v0.0.19 (Node >=22). CommonJS require will fail.","wrong":"const tldrLint = require('tldr-lint')","symbol":"tldrLint","correct":"import tldrLint from 'tldr-lint'"},{"note":"Alias for default export; same as tldrLint.","wrong":"","symbol":"tldrl","correct":"import tldrl from 'tldr-lint'"},{"note":"Named export for programmatic linting. ESM-only.","wrong":"const { lint } = require('tldr-lint')","symbol":"lint","correct":"import { lint } from 'tldr-lint'"},{"note":"Named export for formatting. Available since v0.0.15.","wrong":"","symbol":"format","correct":"import { format } from 'tldr-lint'"}],"quickstart":{"code":"import tldrLint from 'tldr-lint';\nconst { lint, format } = tldrLint;\nconst page = `# example\\n\\n> A test page.\\n\\n- Description:\\n\\n\\`command --flag\\`\\n`;\nconst errors = lint(page);\nconsole.log('Errors:', errors);\nconst formatted = format(page);\nconsole.log('Formatted:', formatted);","lang":"typescript","description":"Shows programmatic linting and formatting of a tldr page string using ESM imports."},"warnings":[{"fix":"Use file paths in CLI arguments; use content string when importing.","message":"CLI and programmatic API treat input differently: CLI expects file paths, programmatic API expects content string.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Upgrade Node to v22 or later.","message":"Dropped support for Node 18 in v0.0.19; requires Node >=22.","severity":"breaking","affected_versions":">=0.0.19"},{"fix":"Use exactly 'More information: ' (with space after colon).","message":"TLDR016 expects the exact text 'More information:' with a trailing space; case-sensitive.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use exactly 'Note: ' (with space after colon).","message":"TLDR020 expects 'Note:' with a trailing space; case-sensitive.","severity":"gotcha","affected_versions":">=0.0.15"},{"fix":"Use -o <file> or -i for in-place formatting.","message":"Formatting with -f outputs to stdout by default; -o or -i required to write to file.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Change to import tldrLint from 'tldr-lint' and ensure your project is ESM (type: module in package.json or .mjs extension).","cause":"Package is ESM-only but imported using require().","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/tldr-lint/index.js from /path/to/script.js not supported."},{"fix":"Use import { lint } from 'tldr-lint' directly, or use default export and destructure: const { lint } = tldrLint.","cause":"Using wrong import: tldr-lint exports lint as a named export, not a method on default export.","error":"TypeError: tldrLint.lint is not a function"},{"fix":"Remove leading whitespace from the file.","cause":"File starts with whitespace before any content.","error":"TLDR001: File should contain no leading whitespace"},{"fix":"Change 'Prints' to 'Print', 'Printing' to 'Print'.","cause":"Description uses present or gerund tense instead of infinitive.","error":"TLDR104: Example descriptions should prefer infinitive tense"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}