New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

textlint-rule-no-bracket-nightly

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

textlint-rule-no-bracket-nightly

textlint rule for no bracket

latest
Source
npmnpm
Version
0.1.0-28614564.d32906a
Version published
Maintainers
1
Created
Source

textlint-rule-no-bracket

textlint rule for no bracket

📖 Rule Details

This rule checks whether the disallowed brackets are present in the sentences.

🍭 Example

For example, if full-width parenthesis and lenticular brackets are not allowed, the following are NG and OK:

❌ NG

They are coming to our house after work(around six o'clock).

【重要】これは(秘密)です。

✅ OK

They are coming to our house after work (around six o'clock).

[重要] これは(秘密)です。

💿 Installlation

Install with npm:

npm install textlint-rule-no-bracket

🚀 Usages

Configure .textlintrc

It’s recommended that this rule is used in .textlintrc.js.

This rule allows all brackets by default. So you need to put to disallowBrackets option which brackets you do not allow.

Below is an example of using full-width parenthesis and lenticular brackets:

const { FullWidthParenthesis, LenticularBrackets } =
  require('textlint-rule-no-bracket').brackes

module.exports = {
  rules: {
    'no-bracket': {
      disallowBrackets: [FullWidthParenthesis, LenticularBrackets]
    }
  }
}

Custom disallow brackets

If you would like to use other brackets, you can put the bracket scheme.

You must define the bracket scheme, which is an object with following the properties:

  • name: the name of the bracket
  • start: the opening bracket character
  • end: the closing bracket character
module.exports = {
  rules: {
    'no-bracket': {
      disallowBrackets: [
        {
          name: 'Double Angle Quotation Mark',
          start: '«',
          end: '»'
        }
      ]
    }
  }
}

🔨 Support Built-in Brackets

  • Parenthesis: ( and )
  • Square Brackets: [ and ]
  • Curly Brackets: { and }
  • Full-Width Parenthesis: and
  • Full-Width Square Brackets: and
  • Full-Width Curly Brackets: and
  • Corner Brackets: and
  • White Corner Brackets: and
  • Less-Than and Greater-Than Angle Brackets: < and >
  • Lenticular Brackets: and
  • White Lenticular Brackets: and
  • White Square Brackets: and

If you would like to use these built-in brackets and custom brackets, you can use spread syntax (...) as follows:

const { defaultBrackets } = require('textlint-rule-no-bracket')

module.exports = {
  rules: {
    'no-bracket': {
      disallowBrackets: [
        {
          name: 'Double Angle Quotation Mark',
          start: '«',
          end: '»'
        },
        ...defaultBrackets
      ]
    }
  }
}

🙌 Contributing guidelines

If you are interested in contributing to textlint-rule-no-bracket, I highly recommend checking out the contributing guidelines here. You'll find all the relevant information such as how to make a PR, how to setup development) etc., there.

©️ License

MIT ©️ 2024 kazupon

Keywords

textlint

FAQs

Package last updated on 28 May 2024

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