Skip to content

2.0.0

Compare
Choose a tag to compare
@azu azu released this 22 Dec 04:35
· 196 commits to master since this release

textlint-plugin-jtf-style から textlint-rule-preset-jtf-style へとリネームされました。

またプラグインではなくプリセットとして動くように変更されています。

プリセットはtextlint 5.1.0から導入された機能で、ルールのセットを一つのまとまりとして扱うものです。
(プラグインにも同様の機能が一機能としてありましたが、5.1.0でプリセットという名前で同様の機能を切り離しました)

マイグレーション方法

textlint-plugin-jtf-style から textlint-rule-preset-jtf-style へ移行したい場合、

npm uninstall -D textlint-plugin-jtf-style
npm install -D textlint textlint-rule-preset-jtf-style

した後、.textlintrc

{
    "plugins": [
        "jtf-style"
    ],
    "rules": {
        "jtf-style/2.1.2.漢字": true,
        "jtf-style/2.1.5.カタカナ": true,
        "jtf-style/2.1.6.カタカナの長音": true,
        "jtf-style/2.2.1.ひらがなと漢字の使い分け": true
    }
}

以下のように書き換えれば完了です。

{
    "rules": {
        "preset-jtf-style": {
            "2.1.2.漢字": true,
            "2.1.5.カタカナ": true,
            "2.1.6.カタカナの長音": true,
            "2.2.1.ひらがなと漢字の使い分け": true
        }
    }
}

preset-jtf-style 以下にプリセットのルールのそれぞれの設定を書く形になります。
プリセットのデフォルト設定を使う場合はプリセット自体をtrueとすれば動作します。

{
    "rules": {
        "preset-jtf-style": true
    }
}

コマンドライン

コマンドラインから利用する場合は--preset引数を利用できます。

npm install -g textlint textlint-rule-preset-jtf-style
textlint --preset textlint-rule-preset-jtf-style README.md