Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

textlint-rule-various-nested-pairs

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

textlint-rule-various-nested-pairs

textlint rule for checking nested pairs

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

textlint-rule-various-nested-pairs

textlint rule to check duplicated nested pairs and nested pairs with wrong order.

检测是否正确地嵌套了不同的括号、引号等,包括是否重复嵌套,是否按指定顺序嵌套。

安装 Install

Install with npm:

npm install textlint-rule-textlint-rule-various-nested-pairs

使用 Usage

Via .textlintrc(Recommended)

.textlintrc中添加(推荐)

{
  "rules": {
    "textlint-rule-various-nested-pairs": true
  }
}

Via CLI

通过命令行调用

textlint --rule textlint-rule-various-nested-pairs README.md

选项 Options

pairs

可配置pairs选项,列举需要检查是否重复嵌套的 pairs。

Use this option to list all pairs that need to be checked if nested duplicated.

{
  "rules": {
    "various-nested-pairs": {
      //  默认配置 default option
      "pairs": ["()", "()", "[]", "【】", "〔〕"]
    }
  }
}

examples:

text(word word (word)) // NG
text(word word 〔ffff〕) // good
orderedPairs

可配置orderedPairs选项,列举需要检查是否重复嵌套以及按一定顺序嵌套的 pairs.

Use this option to list all pairs that need to be checked if nested duplicated and with right order.

{
  "rules": {
    "various-nested-pairs": {
      //  默认配置 default option
      "orderPairs": [["\"\"", "''"], ["“”", "‘’"], ["「」", "『』"]]
    }
  }
}

examples:

'Hello world', He said // NG
"Hello world", He said // good

'"Hello world" is the first lesson', He said // ng
"'Hello world' is the first lesson", He said // good
ignoredHtmlTags

搭配textlint-plugin-html使用时,可以配置ignoredHtmlTags选项,它是一个数组,表示忽略哪些 HTML 标签内的内容。默认为["code", "pre"]

When using with textlint-plugin-html, add this option to ignore contents of some tags. Default Value is ["code", "pre"].

开发 Development

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 © chenyulu

Keywords

FAQs

Package last updated on 21 May 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc