
Product
Introducing Reports: An Extensible Reporting Framework for Socket Data
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.
textlint-rule-various-nested-pairs
Advanced tools
textlint rule to check duplicated nested pairs and nested pairs with wrong order.
检测是否正确地嵌套了不同的括号、引号等,包括是否重复嵌套,是否按指定顺序嵌套。
Install with npm:
npm install textlint-rule-textlint-rule-various-nested-pairs
Via .textlintrc(Recommended)
在.textlintrc中添加(推荐)
{
"rules": {
"textlint-rule-various-nested-pairs": true
}
}
Via CLI
通过命令行调用
textlint --rule textlint-rule-various-nested-pairs README.md
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"].
Builds source codes for publish to the lib folder. You can write ES2015+ source codes in src/
folder.
npm run build
Run test code in test folder. Test textlint rule by
textlint-tester.
npm test
MIT © chenyulu
FAQs
textlint rule for checking nested pairs
The npm package textlint-rule-various-nested-pairs receives a total of 0 weekly downloads. As such, textlint-rule-various-nested-pairs popularity was classified as not popular.
We found that textlint-rule-various-nested-pairs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Product
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.