0.1.0 • Published 5 years ago

textlint-rule-ng-regexp v0.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

textlint-rule-ng-regexp

CircleCI Greenkeeper badge

Install

Install with npm:

npm install textlint-rule-ng-regexp

Usage

Via .textlintrc(Recommended)

{
  "rules": {
    "ng-regexp": {
      "words": [
        {
          // first item is RegExp pattern
          // second is RegExp flag: "i", "g", "m". Default: "g".
          // Any option is added "g" flag
          "pattern": ["hoge"] // => new RegExp('hoge', 'g')
        },
        {
          "pattern": ["fuga", "i"] // => new RegExp('fuga', 'ig')
        },
        {
          "pattern": ["piyo", "i"], // => new RegExp('piyo', 'ig')
          "exclude": ["piyopiyo"], // => new RegExp('piyopiyo', 'g')
          "correct": "ponyo"
        }
      ]
    }
  }
}

Via CLI

textlint --rule ng-regexp README.md

Build

Builds source codes for publish to the lib folder. You can write ES2015+ source codes in src/ folder.

npm run build

Tests

Run test code in test folder. Test textlint rule by textlint-tester.

npm test

License

MIT ©