textlint + prh による文章校正
textlint + prh による文章校正
textlint + prh
textlintは自然言語の文章校正ツール
prhは表記ゆれの修正のための文章校正ツール
package.jsonを作成した上で、以下のコマンドを実行。必要に応じて、生成されるpackage-lock.jsonもGit管理下にしておく。
$ npm install実行。前者は指摘のみ。後者は自動修正可能な箇所は修正まで行う。
$ npm run lint
$ npm run fixpackage.json
{
"name": "redis-book",
"version": "0.0.0",
"description": "Redis book",
"main": "index.js",
"directories": {
"doc": "doc"
},
"scripts": {
"lint": "textlint --cache --experimental --parallel ./ch*.md",
"fix": "textlint --cache --experimental --parallel ./ch*.md --fix"
},
"repository": {},
"keywords": [],
"author": "Syogo Hayashi",
"license": "proprietary",
"private": "true",
"bugs": {},
"homepage": "",
"devDependencies": {
"textlint": "^12.1.0",
"textlint-rule-preset-ja-spacing": "^2.2.0",
"textlint-rule-preset-ja-technical-writing": "^7.0.0",
"textlint-rule-preset-jtf-style": "^2.3.12",
"textlint-rule-prh": "^5.3.0",
"textlint-rule-spellcheck-tech-word": "^5.0.0"
},
"dependencies": {
"textlint-filter-rule-allowlist": "^4.0.0",
"textlint-filter-rule-comments": "^1.2.2"
}
}.textlintrc.json
.prh.yaml
スクリプト
セットアップ
実装
実行例
References
Last updated