Skip to content

Commit

Permalink
fix: change rule name (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazupon committed May 28, 2024
1 parent 66cf4b1 commit c1c7efe
Show file tree
Hide file tree
Showing 13 changed files with 1,505 additions and 934 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ body:
label: Validations
description: Before submitting the issue, please make sure you do the following
options:
- label: Follow our [Code of Conduct](https://github.com/kazupon/textlint-rule-no-bracket/blob/main/CODE_OF_CONDUCT.md)
- label: Follow our [Code of Conduct](https://github.com/kazupon/textlint-rule-no-pair/blob/main/CODE_OF_CONDUCT.md)
required: true
- label: Read the [Contributing Guide](https://github.com/kazupon/textlint-rule-no-bracket/blob/main/CONTRIBUTING.md).
- label: Read the [Contributing Guide](https://github.com/kazupon/textlint-rule-no-pair/blob/main/CONTRIBUTING.md).
required: true
- label: Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
contact_links:
- name: 🙌 Contribution Guide
url: https://github.com/kazupon/textlint-rule-no-bracket/blob/main/CONTRIBUTING.md
url: https://github.com/kazupon/textlint-rule-no-pair/blob/main/CONTRIBUTING.md
about: Please read through before making contributions.
- name: ⁉️ Why and How to make a reproduction?
url: https://antfu.me/posts/why-reproductions-are-required
Expand Down
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ body:
id: feature-description
attributes:
label: Clear and concise description of the problem
description: 'As a developer using textlint-rule-no-bracket. I want [goal / wish] so that [benefit]. If you intend to submit a PR for this issue, tell us in the description. Thanks!'
description: 'As a developer using textlint-rule-no-pair. I want [goal / wish] so that [benefit]. If you intend to submit a PR for this issue, tell us in the description. Thanks!'
validations:
required: true
- type: textarea
Expand All @@ -36,9 +36,9 @@ body:
label: Validations
description: Before submitting the issue, please make sure you do the following
options:
- label: Follow our [Code of Conduct](https://github.com/kazupon/textlint-rule-no-bracket/blob/main/CODE_OF_CONDUCT.md)
- label: Follow our [Code of Conduct](https://github.com/kazupon/textlint-rule-no-pair/blob/main/CODE_OF_CONDUCT.md)
required: true
- label: Read the [Contributing Guide](https://github.com/kazupon/textlint-rule-no-bracket/blob/main/CONTRIBUTING.md).
- label: Read the [Contributing Guide](https://github.com/kazupon/textlint-rule-no-pair/blob/main/CONTRIBUTING.md).
required: true
- label: Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
required: true
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Thank you for contributing!
Before submitting the PR, please make sure you do the following:
- Read the [Contributing Guide](https://github.com/kazupon/textlint-rule-no-bracket/blob/main/CONTRIBUTING.md).
- Read the [Contributing Guide](https://github.com/kazupon/textlint-rule-no-pair/blob/main/CONTRIBUTING.md).
- Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
- Provide a description in this PR that addresses **what** the PR is solving, or reference the issue that it solves (e.g. `fixes #123`).
- Ideally, include relevant tests that fail without this PR but pass with it.
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@

### Work Step Example

- Fork the repository from [gh-changelogen](https://github.com/kazupon/textlint-rule-no-bracket) !
- Fork the repository from [gh-changelogen](https://github.com/kazupon/textlint-rule-no-pair) !
- Create your topic branch from `master`: `git branch my-new-topic origin/main`
- Add codes and pass tests !
- Commit your changes: `git commit -am 'Add some topic'`
- Push to the branch: `git push origin my-new-topic`
- Submit a pull request to `main` branch of `kazupon/textlint-rule-no-bracket` repository !
- Submit a pull request to `main` branch of `kazupon/textlint-rule-no-pair` repository !

## Development Setup

Expand Down
46 changes: 23 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# textlint-rule-no-bracket
# textlint-rule-no-pair

textlint rule for no bracket
textlint rule for no pair

## 📖 Rule Details

Expand Down Expand Up @@ -31,7 +31,7 @@ They are coming to our house after work (around six o'clock).
Install with [npm](https://www.npmjs.com/):

```sh
npm install textlint-rule-no-bracket
npm install textlint-rule-no-pair
```

## 🚀 Usages
Expand All @@ -40,40 +40,40 @@ npm install textlint-rule-no-bracket

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.
**This rule allows all pair by default**. So you need to put to `disallowPairs` option which pairs you do not allow.

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

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

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

### Custom disallow brackets
### Custom disallow pairs

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

You must define the bracket scheme, which is an object with following the properties:
You must define the pair 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
- `start`: the opening pair character
- `end`: the closing pair character

these interface is defined in [here](https://github.com/kazupon/textlint-rule-no-bracket/blob/c43a27eca5809f485272ce2d5e16a3de88e09d1a/src/brackets.ts#L8-L21)
these interface is defined in [here](https://github.com/kazupon/textlint-rule-no-pair/blob/c43a27eca5809f485272ce2d5e16a3de88e09d1a/src/brackets.ts#L8-L21)

```js
module.exports = {
rules: {
'no-bracket': {
disallowBrackets: [
'no-pair': {
disallowPairs: [
{
name: 'Double Angle Quotation Mark',
start: '«',
Expand All @@ -85,7 +85,7 @@ module.exports = {
}
```

## 🔨 Support Built-in Brackets
## 🔨 Support Built-in Pairs

- Parenthesis: `(` and `)`
- Square Brackets: `[` and `]`
Expand All @@ -100,23 +100,23 @@ module.exports = {
- White Lenticular Brackets: `` and ``
- White Square Brackets: `` and ``

These built-in brackets is defined in [here](https://github.com/kazupon/textlint-rule-no-bracket/blob/main/src/brackets.ts#L27-L145)
These built-in pairs is defined in [here](https://github.com/kazupon/textlint-rule-no-pair/blob/main/src/brackets.ts#L27-L145)

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

```js
const { defaultBrackets } = require('textlint-rule-no-bracket')
const { defaultPairs } = require('textlint-rule-no-pair')

module.exports = {
rules: {
'no-bracket': {
disallowBrackets: [
'no-pair': {
disallowPairs: [
{
name: 'Double Angle Quotation Mark',
start: '«',
end: '»'
},
...defaultBrackets
...defaultPairs
]
}
}
Expand All @@ -125,7 +125,7 @@ module.exports = {

## 🙌 Contributing guidelines

If you are interested in contributing to `textlint-rule-no-bracket`, I highly recommend checking out [the contributing guidelines](/CONTRIBUTING.md) here. You'll find all the relevant information such as [how to make a PR](/CONTRIBUTING.md#pull-request-guidelines), [how to setup development](/CONTRIBUTING.md#development-setup)) etc., there.
If you are interested in contributing to `textlint-rule-no-pair`, I highly recommend checking out [the contributing guidelines](/CONTRIBUTING.md) here. You'll find all the relevant information such as [how to make a PR](/CONTRIBUTING.md#pull-request-guidelines), [how to setup development](/CONTRIBUTING.md#development-setup)) etc., there.

## ©️ License

Expand Down
Loading

0 comments on commit c1c7efe

Please sign in to comment.