textlint-rule-zh-no-redundant-space-around-token

0.0.3 • Public • Published

textlint-rule-zh-no-redundant-space-around-token

textlint-rule-preset-zh-technical-writing 提供的适用于中文技术文档写作的 textlint 规则,用于检测文本中多余的空格。

规则介绍

本规则可被自动修复,可以向 textlint 传递 --fix 参数来自动修复文本中出现的错误。

通过规则的例子

已经 200% 了

哇浪,test sentence 喔!

本句没有空格,何来多余一说?

违反规则的例子

打  字  带  空  格

他说:“I  don't speak   English”

配置项

暂无。

提出 issue

如果你在使用本规则的过程中出现了误报,或者对本规则有任何疑问或者改进意见,欢迎提出 issue

使用方法

方法一:直接使用 textlint-rule-preset-zh-technical-writing

这是最简单的方法,参见 textlint-rule-preset-zh-technical-writing 的 README

方法二:手动安装

使用 npm 安装:

npm install -g textlint-rule-zh-core textlint-rule-zh-no-redundant-space-around-token

创建 entry.js,名称任意:

const { withRules } = require('textlint-rule-zh-core');
const correctlyOrderedPairs = require('textlint-rule-zh-no-redundant-space-around-token');

// 这里 withRule(...) 的返回值就是你可以提供给 textlint 的 rule 对象
module.exports = withRules([correctlyOrderedPairs]);

运行 textlint:

textlint --rulesdir <entry.js所在的文件夹路径> [其他参数] <要lint的文件名>

Package Sidebar

Install

npm i textlint-rule-zh-no-redundant-space-around-token

Weekly Downloads

3

Version

0.0.3

License

MIT

Unpacked Size

5.66 kB

Total Files

4

Last publish

Collaborators

  • darkyzhou