Skip to content

kufu/textlint-rule-preset-smarthr

Repository files navigation

textlint-rule-preset-smarthr

SmartHRらしい文書を書くための、textlintルールプリセットを提供します。

インストール

Install with npm:

npm install textlint-rule-preset-smarthr

使い方

Via .textlintrc(Recommended)

Via CLI

textlint --rule preset-smarthr README.md

Build

ソースコードをビルドして、libフォルダに公開します。 TypeScriptのソースコードはsrc/フォルダに書くことができます。

npm run build

Tests

testフォルダ内のテストコードを実行します。 testの詳細はtextlint-testerを参照してください。

npm test

基本設定

すべてのルールを有効化して使う場合は、次のように設定してください。

{
  "rules": {
    "preset-smarthr": true
  }
}

デフォルト設定

デフォルトでは、次のような設定になっています。個別にルールを有効・無効化することも可能です。

{
  "rules": {
    "preset-smarthr": {
      "prh-rules": true,
      "ja-no-mixed-period": true,
      "no-hankaku-kana": true,
      "@textlint-rule/no-unmatched-pair": true,
      "sentence-length": {
        "max": 120
      },
      "no-doubled-conjunctive-particle-ga": true,
      "no-double-negative-ja": true,
      "ja-no-abusage": true,
      "ja-no-redundant-expression": true,
      "no-mixed-zenkaku-and-hankaku-alphabet": true,
      "ja-keishikimeishi": {
        "detection_hou_kata" : false,
        "detection_ue" : false
      },
      "ja-hiragana-fukushi": true,
      "ja-hiragana-hojodoushi": true,
      "ja-hiragana-daimeishi": true,
      "ja-no-space-around-parentheses": true,
      "ja-no-space-between-full-width": true,
      "ja-space-between-half-and-full-width": {
        "space": "never"
      },
      "ja-space-after-exclamation": true,
      "ja-space-after-question": true,
      "ja-space-around-code": false
    }
  }
}

設定ルール一覧

補足1: textlint-rule-preset-ja-spacingのルールプリセットを分解して設定しています。

辞書設定

表記ゆれ修正用の辞書の設定にはtextlint-rule-prhを使っています。 対応用語はdict/フォルダに入っている.ymlを確認してください。

License

MIT