eslint-plugin-textlint

0.2.2 • Public • Published

eslint-plugin-textlint

npm test

Introduction

Enable textlint in eslint.

If there are any advices or questions, submit issue.

中文版 README

Installation

You'll first need to install ESLint and TextLint:

npm i eslint textlint --save-dev

Next, install eslint-plugin-textlint:

npm install eslint-plugin-textlint --save-dev

Usage

.eslintrc configuration

  1. Add textlint to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:
{
    "plugins": [
        "textlint"
    ]
}
  1. Configure the rules you want to use under the rules section in .eslintrc.
{
    "rules": {
        "textlint/textlint": [2, { "lintType": "all", "ignoreImportDeclaration": true }]
    }
}

rule: textlint/textlint

This rule has an object option:

  • "lintType": "all" (default) | "comment" | "code"
    • "all": (default) inspect comments and codes.
    • "comment": inspect only comments.
    • "code": inspect only codes (strings and templates in codes).
  • "ignoreImportDeclaration": true (default) | false
    • true: ignore literal in import(ES Module) and require(CMD) statement.
    • false: check literal in import(ES Module) and require(CMD) statement.

.textlintrc configuration

  1. Add "@textlint/text": true to the plugins section of your .textlintrc configuration file.
{
  "plugins": {
    "@textlint/text": true,
  }
}
  1. Configure the rules you want to use under the rules section in .textlintrc.
{
  "rules": {
    // whatever you want
  }
}

Rules

🔧 Automatically fixable by the --fix CLI option.

Name Description 🔧
textlint Enable textlint in eslint 🔧

License

eslint-plugin-textlint is licensed under the MIT License.

Package Sidebar

Install

npm i eslint-plugin-textlint

Weekly Downloads

161

Version

0.2.2

License

MIT

Unpacked Size

15.4 kB

Total Files

9

Last publish

Collaborators

  • dujianhao