3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

textlintと任意のpresetをブラウザ向けにバンドルするツール

Last updated at Posted at 2020-02-17

アイデア

Browser上でtextlintを実行するでは、バンドルされるルールはtextlint-rule-preset-mobilus固定にしていたので、

より汎用的に任意のpresetをバンドルできるようにツール化した。

できたもの

textlint-bundler

使い方

  1. プロジェクトを初期化する

    $ npm init

  2. 利用したいpresetを選択または 作成してインストールする。

    $ npm install textlint-rule-preset-xxxx

  3. package.jsontextlint.presetとして利用するpresetを記載する。
    このときxxxx はモジュール名から textlint-rule-preset を省いたものを指定する。 例: japaneseja-spacing

      "textlint": {
        "preset" : "xxxx"
      }
    
  4. npx textlint-bundler npx経由ではエラーが発生するのでインストールする

    $ npm install textlint-bundler --save-dev

  5. textlint-bundlerの実行

    $ node_modules/.bin/textlint-bundler

  6. 出力例をブラウザで確認

    $ npx http-server ./dist -o /example.html

3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?