Skip to content

v0.9.0

Choose a tag to compare

@PerfectPan PerfectPan released this 17 Nov 14:37
· 3 commits to main since this release
1dcf174

What changed

New opt-in export @perfectpan/lint-config/doc-translations (#13): a zero-dependency check for translated Markdown documents, called from a repository script with runDocTranslations(options, process.argv.slice(2)). It works with a translation beside each document (foo.zh-CN.md) or a tree per language (docs/en → docs/zh-CN), chosen through translationOf, and checks per pair:

  • the translation exists, every translation has a source in scope, and translationOf gives each source its own path inside translations;
  • an optional header line;
  • headings (levels in order), code blocks (unchanged), tables (rows and columns), list items (kind and indent) and links in order, with links to translated documents pointing to their translations and every fragment naming a GitHub heading anchor or id of its target;
  • with stamp: true, a <!-- source-blob: <hash> --> line holding the source's Git blob hash, so an edited source fails until its translation is updated and recorded with --write <path>....

Usage is in the README ("Documentation translations"); the reasons and the line scan's limits are in docs/decisions.md#documentation-translations.

What newly fails

Nothing. No shared lint, format, tsconfig, jscpd or Knip setting changed, and the new module runs only in a repository that calls it, so the impact on every existing consumer is 0 findings.

Upgrade

Change github:PerfectPan/lint-config#v0.8.0 to #v0.9.0 and reinstall. To adopt the check, add a script like the README example and run it in CI and the pre-commit hook.