textlint-rule-zh 系列规则的核心包,只有搭配它使用才能让 textlint 正确加载规则。
这里以 textlint-rule-zh-correctly-ordered-pairs 为例:
npm install -g textlint-rule-zh-core textlint-rule-zh-correctly-ordered-pairs
import { withRules } from 'textlint-rule-zh-core';
import correctlyOrderedPairs from 'textlint-rule-zh-correctly-ordered-pairs';
import { textlint } from 'textlint';
const rule = withRules([correctlyOrderedPairs]);
textlint.setupRules(rule);