textlint-rule-ja-space-around-code

インラインコードの周りをスペースで囲むかどうかを決めるtextlintルール

Usage no npm install needed!

<script type="module">
  import textlintRuleJaSpaceAroundCode from 'https://cdn.skypack.dev/textlint-rule-ja-space-around-code';
</script>

README

textlint-rule-ja-space-around-code textlint rule

インラインコードの周りをスペースで囲むかどうかを決めるtextlintルール

インラインコードとはTxtASTCode nodeのことです。

このルールでは、インラインコードの前後が日本語である場合に半角スペースを入れるかを決定します。 オプションでスペースの有無を決定できます。

`code` と日本語の間はスペースを空ける
`code`と日本語の間はスペースを空けない

Install

Install with npm:

npm install textlint-rule-ja-space-around-code

Usage

Via .textlintrc(Recommended)

{
    "rules": {
        "ja-space-around-code": true
    }
}

Via CLI

textlint --rule ja-space-around-code README.md

Options

  • before: boolean
    • デフォルト: false
    • trueなら、Codeの前に半角スペースを入れる
  • after: boolean
    • デフォルト: false
    • trueなら、Codeの後に半角スペースを入れる

デフォルト値は次のようになります。

{
    "rules": {
        "ja-space-around-code": {
            "before": false,
            "after": false
        }
    }
}

Fixable

textlint rule

textlint --fixの自動修正に対応しています。

Changelog

See Releases page.

Running tests

Install devDependencies and Run npm test:

npm i -d && npm test

Contributing

Pull requests and stars are always welcome.

For bugs and feature requests, please create an issue.

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Author

License

MIT © azu