https://github.com/textlint/textlint-rule-template
This is TEMPLATE REPOSITORY for creating textlint rule.
https://github.com/textlint/textlint-rule-template
template textlintrule
Last synced: about 1 year ago
JSON representation
This is TEMPLATE REPOSITORY for creating textlint rule.
- Host: GitHub
- URL: https://github.com/textlint/textlint-rule-template
- Owner: textlint
- Created: 2016-11-06T07:12:44.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-10-31T09:31:46.000Z (over 1 year ago)
- Last Synced: 2024-10-31T10:25:59.914Z (over 1 year ago)
- Topics: template, textlintrule
- Language: JavaScript
- Homepage:
- Size: 804 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# textlint-rule template
This is TEMPLATE REPOSITORY for creating textlint rule.
## Install
Requirement:
- Git
- Node.js 16+
- npm 8+
Use [create-textlint-rule](https://github.com/textlint/create-textlint-rule):
```
$ npx create-textlint-rule example
```
Or, Run following steps manually:
```sh
ruleName="textlint-rule-"
git clone --depth=1 https://github.com/textlint/textlint-rule-template.git ${ruleName}
cd ${ruleName}
# Initialize git
rm -rf .git/
rm -rf .github/
git init
# Initialize npm
npm init
npm install
# Initialize README
# Notice: force update exist README.md
./node_modules/.bin/textlint-scripts init
```
## Usage
See [textlint-scripts](https://github.com/textlint/textlint-scripts "textlint-scripts") for more details.
### 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](https://github.com/textlint/textlint-tester "textlint-tester").
npm test
### Publish
Publish your rule to [npm](https://www.npmjs.com/).
# Update version and git tag `patch` or `minor` or `major`
npm version {patch|minor|major}
npm publish
## How to write textlint rule?
See documents.
- [textlint/rule.md at master · textlint/textlint](https://github.com/textlint/textlint/blob/master/docs/rule.md "textlint/rule.md at master · textlint/textlint")