nishimura.clubnishimura.club

textlintを使ってみる

作成日
2021-06-21
更新日
2021-06-21

経緯

ブログやドキュメントを頻繁に書くので、良い文章を書くために導入してみる。

インストール

yarn add -D \ textlint \ textlint-rule-preset-ja-spacing \ textlint-rule-preset-ja-technical-writing \ textlint-rule-spellcheck-tech-word

.textlintrcの生成

yarn textlint --init

textlintの実行

yarn textlint ./public-docs/* yarn textlint ./public-docs/* --fix # 自動修正

表記揺れ

touch prh.yml

textlintrcに追記する。

{ ... "spellcheck-tech-word": true, "prh": { "rulePaths": [ "./prh.yml" ] } } }

prh.yml

version: 1 rules: - expected: Google specs: - from: google to: Google - expected: GitHub specs: - from: github to: GitHub

参考

Related