Skip to content

Introduction

Zh is a monorepo for creating ESLint and Prettier plugins that format Chinese text according to modern Chinese documentation conventions.

Features

  • Chinese-aware: Specially designed for Chinese text, understanding the nuances of mixed Chinese and English content
  • Configurable: Choose which rules to enable and customize options to match your project's style
  • Fast: Built with performance in mind, format your Chinese documentation in milliseconds

Tools

  • prettier-plugin-zh: A Prettier plugin for formatting Chinese text in markdown files
  • eslint-plugin-zh: (Coming soon) An ESLint plugin for linting Chinese text

Rules

Zh provides various rules for formatting Chinese text:

RuleDescription
space-around-alphabetPlace one space before/after English words
space-around-numberPlace one space before/after numbers
space-around-codePlace one space before/after inline code block
space-around-linkPlace one space before/after inline link block
no-duplicate-punctuationRemove repetitive duplicate punctuation
no-space-around-fullwidthRemove space around fullwidth characters
no-space-between-number-unitRemove space between number and unit
zhIgnorePatternsIgnore specific text from formatting

Credits

License

All packages are licensed under the MIT License.

Released under the MIT License.