{"id":25873,"library":"lint-md","title":"lint-md","description":"lint-md is a core library for linting Chinese markdown files using AST-based rules. Version 0.2.0 is currently the latest and only version on npm. It provides lint, fix, and getDescription APIs, supporting over 17 rules covering spacing around Chinese/English, number formatting, empty content checks, and more. Rules can be configured with severity levels (ignore/warning/error) and options. Differentiator: focuses specifically on Chinese writing conventions, unlike generic markdown linting tools.","status":"active","version":"0.2.0","language":"javascript","source_language":"en","source_url":"https://github.com/hustcc/lint-md","tags":["javascript","lint","markdown","lint-md","ast-plugin"],"install":[{"cmd":"npm install lint-md","lang":"bash","label":"npm"},{"cmd":"yarn add lint-md","lang":"bash","label":"yarn"},{"cmd":"pnpm add lint-md","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Named export, not default.","wrong":"import lint from 'lint-md'","symbol":"lint","correct":"import { lint } from 'lint-md'"},{"note":"ESM only, CommonJS require may work but not officially supported.","wrong":"const { fix } = require('lint-md')","symbol":"fix","correct":"import { fix } from 'lint-md'"},{"note":"Named export.","wrong":"import getDescription from 'lint-md'","symbol":"getDescription","correct":"import { getDescription } from 'lint-md'"},{"note":"Exports version string.","wrong":null,"symbol":"version","correct":"import { version } from 'lint-md'"}],"quickstart":{"code":"import { lint, fix, getDescription } from 'lint-md';\n\nconst markdown = '# Hello 中文';\nconst rules = { 'space-round-alphabet': 2 };\nconst errors = lint(markdown, rules);\nconsole.log('Errors:', errors);\n// Fix the markdown\nconst fixed = fix(markdown);\nconsole.log('Fixed:', fixed);\n// Get description for a rule\nconst desc = getDescription('space-round-alphabet', 'zh_CN');\nconsole.log('Description:', desc);","lang":"typescript","description":"Demonstrates lint, fix, and getDescription APIs with a simple markdown example."},"warnings":[{"fix":"Pass a rules object with rule names mapped to 0, 1, or 2.","message":"All rules default to error level; must explicitly set rules object to ignore.","severity":"gotcha","affected_versions":">=0.2.0"},{"fix":"Use [2, { length: 100, exclude: [] }] instead of { 2: {...} }.","message":"Rule options for no-long-code are only accepted when severity is an array, not a number.","severity":"gotcha","affected_versions":">=0.2.0"},{"fix":"Pass string 'en_US' or 'zh_CN'.","message":"getDescription second parameter is a language string (e.g., 'zh_CN'), not a locale object.","severity":"gotcha","affected_versions":">=0.2.0"},{"fix":"Read file content first with fs.readFileSync().","message":"Lint and fix work on raw markdown strings, not file paths.","severity":"gotcha","affected_versions":">=0.2.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'npm install lint-md' and ensure import is from 'lint-md' (no subpath).","cause":"Package not installed or import path incorrect.","error":"Cannot find module 'lint-md'"},{"fix":"Use 'import { lint } from \"lint-md\"' instead of 'import lint from \"lint-md\"'.","cause":"Using default import instead of named import.","error":"TypeError: lint is not a function"},{"fix":"Use 'import { fix } from \"lint-md\"' if using ESM.","cause":"Using destructured require incorrectly in ESM context.","error":"Uncaught TypeError: fix is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}