npm.io
4.18.3 • Published 5 months ago

@markuplint/rule-textlint

Licence
MIT
Version
4.18.3
Deps
3
Size
12 kB
Vulns
0
Weekly
0
Stars
627

@markuplint/rule-textlint

npm version

The rule plugin that adapts textlint in markuplint

Install

$ npm install -D @markuplint/rule-textlint

$ yarn add -D @markuplint/rule-textlint

Usage

Example
$ yarn add -D textlint-rule-prh
Load .textlintrc.* config automatically
{
  "rules": {
    "textlint": true
  }
}
{
  // `html` plugin will be used automatically by `markuplint`
  // but make sure to enable it manually
  // if you are using `textlint` as cli at the same time
  // "plugins": ["html"],
  "rules": {
    "prh": {
      "rulePaths": ["../prh.yml"]
    }
  }
}
Use independent textlint config
import path from 'node:path';
import { fileURLToPath } from 'node:url';

import Prh from 'textlint-rule-prh';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

export default {
  rules: {
    textlint: {
      options: {
        rules: [
          {
            ruleId: 'prh',
            rule: Prh,
            options: {
              rulePaths: [path.resolve(__dirname, '..', 'prh.yml')],
            },
          },
        ],
      },
    },
  },
};