textlint-scripts

14.0.4 • Public • Published

textlint-scripts

textlint scripts help you to create textlint rule.

Documentation of creating a textlint rule:

Install

Install with npm:

npm install textlint-scripts --save-dev

Usage

Use textlint-scripts as npm-scripts.

{
    "scripts" : {
        "build": "textlint-scripts build",
        "test": "textlint-scripts test"
    }
}

📝 TypeScript

textlint-scripts support TypeScript.

textlint-scripts detect the project is TypeScript by tsconfig.json in project root directory.

textlint-scripts build

Build source codes in src/ and output to lib/.

It is built by Babel with env preset.

Additionally, build command inline Node fs calls with babel-plugin-static-fs for browser compatibility. (Web Browser does not support Node.js's fs module, this inlining feature improve compatibility between Node.js and Web Browser.)

📝 Disable inlining by $ NO_INLINE=1 textlint-scripts build.

textlint-scripts test

Test test codes in test/ by Mocha.

Usually test textlint rule using textlint-tester.

Notes: register script

textlint-scripts also provide register script for run-time build. It will help to run tests from your IDE like WebStorm.

# js
mocha --require textlint-scripts/register "test/**/*.js"
# ts
mocha --require textlint-scripts/register-ts "test/**/*.ts"

Changelog

See Releases page.

Author

License

MIT © azu

Readme

Keywords

Package Sidebar

Install

npm i textlint-scripts

Weekly Downloads

482

Version

14.0.4

License

MIT

Unpacked Size

12.1 kB

Total Files

14

Last publish

Collaborators

  • textlint-user
  • azu
  • 0x6b