{"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,"search_vec":"'0.0.22':14 '22':59 '30':25 'activ':17 'api':66 'auto':53 'auto-format':52 'built':43 'capit':31 'check':23 'cli':61 'cover':29 'docker':63 'f':56 'format':10,30,48,54,72 'frequent':20 'generic':36 'includ':50 'javascript':67 'lint':3,5,70 'linter':38,73 'maintain':18 'markdown':37 'node':58 'option':55 'page':12,47,69 'programmat':65 'punctuat':32 'purpos':42 'purpose-built':41 'releas':21 'requir':57 'rule':26 'stabl':15 'structur':34 'support':60 'tldr':2,11,46,68 'tldr-lint':1 'tldr001':27 'tldr109':28 'tool':6 'unlik':35 'use':62 'valid':8,71 'version':13","created_at":"2026-05-01T13:50:13.674197+00:00","updated_at":"2026-05-01T13:50:13.674197+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"tldr-lint","cli_version":null,"type":"library","homepage":"https://tldr.sh","github":"https://github.com/tldr-pages/tldr-lint","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/tldr-lint","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-05-01","next_check":"2026-07-30","install_tag":null}}