forked from kufu/textlint-rule-preset-smarthr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request kufu#1 from kgsi/add-preset
add preset rule & other
- Loading branch information
Showing
14 changed files
with
5,832 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#directory | ||
/src | ||
/test | ||
|
||
#build files | ||
tsconfig.json | ||
|
||
#editor settings | ||
.prettierignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## Ignore files | ||
*.md | ||
*.mdx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,125 @@ | ||
# textlint-rule-preset-smarthr | ||
|
||
[WIP]SmartHRらしい文書を書くためのtextlintルールプリセットです。 | ||
SmartHRらしい文書を書くための、textlintルールプリセットを提供します。 | ||
|
||
## Rules | ||
|
||
* [textlint-rule-ja-no-mixed-period](https://github.com/textlint-ja/textlint-rule-ja-no-mixed-period) | ||
|
||
## Install | ||
## インストール | ||
|
||
Install with [npm](https://www.npmjs.com/): | ||
|
||
npm install textlint-rule-preset-smarthr | ||
|
||
## Usage | ||
## 使い方 | ||
|
||
Via `.textlintrc`(Recommended) | ||
|
||
```json | ||
{ | ||
"rules": { | ||
"preset-smarthr": true | ||
} | ||
} | ||
``` | ||
|
||
Via CLI | ||
### Via CLI | ||
|
||
``` | ||
textlint --rule preset-smarthr README.md | ||
``` | ||
|
||
### Build | ||
|
||
Builds source codes for publish to the `lib` folder. | ||
You can write ES2015+ source codes in `src/` folder. | ||
ソースコードをビルドして、`lib`フォルダに公開します。 | ||
TypeScriptのソースコードは`src/`フォルダに書くことができます。 | ||
|
||
npm run build | ||
``` | ||
npm run build | ||
``` | ||
|
||
### Tests | ||
|
||
Run test code in `test` folder. | ||
Test textlint rule by [textlint-tester](https://github.com/textlint/textlint-tester). | ||
`test`フォルダ内のテストコードを実行します。 | ||
testの詳細は[textlint-tester](https://github.com/textlint/textlint-tester)を参照してください。 | ||
|
||
``` | ||
npm test | ||
``` | ||
### 基本設定 | ||
|
||
すべてのルールを有効化して使う場合は、次のように設定してください。 | ||
|
||
npm test | ||
```json | ||
{ | ||
"rules": { | ||
"preset-smarthr": true | ||
} | ||
} | ||
``` | ||
### デフォルト設定 | ||
|
||
デフォルトでは、次のような設定になっています。個別にルールを有効・無効化することも可能です。 | ||
|
||
```json | ||
{ | ||
"rules": { | ||
"preset-smarthr": { | ||
"prh-rules": true, | ||
"ja-no-mixed-period": true, | ||
"no-hankaku-kana": true, | ||
"@textlint-rule/no-unmatched-pair": true, | ||
"sentence-length": { | ||
"max": 120 | ||
}, | ||
"no-doubled-conjunctive-particle-ga": true, | ||
"no-double-negative-ja": true, | ||
"ja-no-abusage": true, | ||
"ja-no-redundant-expression": true, | ||
"no-mixed-zenkaku-and-hankaku-alphabet": true, | ||
"ja-hiragana-keishikimeishi": true, | ||
"ja-hiragana-fukushi": true, | ||
"ja-hiragana-hojodoushi": true, | ||
"ja-hiragana-daimeishi": true, | ||
"ja-no-space-around-parentheses": true, | ||
"ja-no-space-between-full-width": true, | ||
"ja-space-between-half-and-full-width": { | ||
"space": "never" | ||
}, | ||
"ja-space-after-exclamation": true, | ||
"ja-space-after-question": true, | ||
"ja-space-around-code": false | ||
} | ||
} | ||
} | ||
``` | ||
|
||
## 設定ルール一覧 | ||
|
||
* [textlint-rule-ja-hiragana-daimeishi](https://github.com/lostandfound/textlint-rule-ja-hiragana-daimeishi) | ||
* [textlint-rule-ja-hiragana-fukushi](https://github.com/lostandfound/textlint-rule-ja-hiragana-fukushi) | ||
* [textlint-rule-ja-hiragana-hojodoushi](https://github.com/lostandfound/textlint-rule-ja-hiragana-hojodoushi) | ||
* [textlint-rule-ja-hiragana-keishikimeishi](https://github.com/lostandfound/textlint-rule-ja-hiragana-keishikimeishi) | ||
* [textlint-rule-ja-no-abusage](https://github.com/textlint-ja/textlint-rule-ja-no-abusage) | ||
* [textlint-rule-ja-no-mixed-period](https://github.com/textlint-ja/textlint-rule-ja-no-mixed-period) | ||
* [textlint-rule-ja-no-redundant-expression](https://github.com/textlint-ja/textlint-rule-ja-no-redundant-expression) | ||
* [textlint-rule-max-ten](https://github.com/textlint-ja/textlint-rule-max-ten) | ||
* [textlint-rule-no-double-negative-ja](https://github.com/textlint-ja/textlint-rule-no-double-negative-ja) | ||
* [textlint-rule-no-doubled-conjunction](https://github.com/textlint-ja/textlint-rule-no-doubled-conjunction) | ||
* [textlint-rule-no-doubled-conjunctive-particle-ga](https://github.com/textlint-ja/textlint-rule-no-doubled-conjunctive-particle-ga) | ||
* [textlint-rule-no-doubled-joshi](https://github.com/textlint-ja/textlint-rule-no-doubled-joshi) | ||
* [textlint-rule-no-dropping-the-ra](https://github.com/textlint-ja/textlint-rule-no-dropping-the-ra) | ||
* [textlint-rule-no-hankaku-kana](https://github.com/textlint-ja/textlint-rule-no-hankaku-kana) | ||
* [textlint-rule-no-mix-dearu-desumasu](https://github.com/textlint-ja/textlint-rule-no-mix-dearu-desumasu) | ||
* [textlint-rule-no-mixed-zenkaku-and-hankaku-alphabet](https://github.com/textlint-ja/textlint-rule-no-mixed-zenkaku-and-hankaku-alphabet) | ||
* [textlint-rule-no-nfd](https://github.com/textlint-ja/textlint-rule-no-nfd) | ||
* [textlint-rule-prh](https://github.com/textlint-rule/textlint-rule-prh) | ||
* [textlint-rule-sentence-length](https://github.com/textlint-rule/textlint-rule-sentence-length) | ||
* [textlint-rule-preset-ja-spacing](https://github.com/textlint-ja/textlint-rule-preset-ja-spacing)(補足1) | ||
* textlint-rule-ja-nakaguro-or-halfwidth-space-between-katakana | ||
* textlint-rule-ja-no-space-around-parentheses | ||
* textlint-rule-ja-no-space-between-full-width | ||
* textlint-rule-ja-space-after-exclamation | ||
* textlint-rule-ja-space-after-question | ||
* textlint-rule-ja-space-around-code | ||
* textlint-rule-ja-space-between-half-and-full-width | ||
|
||
補足1: `textlint-rule-preset-ja-spacing`のルールプリセットを分解して設定しています。 | ||
|
||
## 辞書設定 | ||
|
||
表記ゆれ修正用の辞書の設定には`textlint-rule-prh`を使っています。 | ||
対応用語は`dict/`フォルダに入っている`.yml`を確認してください。 | ||
|
||
## License | ||
|
||
MIT © | ||
MIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# SmartHR全体で使われる、基本辞書セット | ||
rules: | ||
- expected: あらかじめ | ||
pattern: 予め | ||
- expected: いたします | ||
pattern: 致します | ||
- expected: いただく | ||
pattern: 頂く | ||
- expected: および | ||
pattern: 及び | ||
- expected: ください | ||
pattern: 下さい | ||
- expected: ご存じ | ||
pattern: ご存知 | ||
- expected: さきほど | ||
pattern: 先程 | ||
- expected: さまざま | ||
pattern: 様々 | ||
- expected: すでに | ||
pattern: 既に | ||
- expected: すなわち | ||
pattern: 即ち | ||
- expected: すべて | ||
pattern: 全て | ||
- expected: そば$1 | ||
pattern: /側([にへが])/ | ||
- expected: たくさん | ||
pattern: 沢山 | ||
- expected: ただ | ||
pattern: 只 | ||
- expected: ただし | ||
pattern: 但し | ||
- expected: ため$1 | ||
pattern: /為([にで])/ | ||
- expected: など$1 | ||
pattern: /等([のが、])/ | ||
- expected: ならびに | ||
pattern: 並びに | ||
- expected: まず | ||
pattern: 先ず | ||
- expected: まで | ||
pattern: 迄 | ||
- expected: もって | ||
pattern: 以て | ||
- expected: もっとも | ||
pattern: 尤も | ||
- expected: でき$1 | ||
pattern: /出来([かがのをは過す損ずなまるたれてそ])/ | ||
- expected: あとで | ||
pattern: 後で | ||
- expected: したうえで | ||
pattern: した上で | ||
- expected: $1さま | ||
pattern: /([従業員])様|([お客])様|([ユーザー])様|([皆])様/ | ||
- expected: 振り込み | ||
pattern: 振込 | ||
- expected: 取り消し | ||
pattern: 取消 | ||
- expected: 差し戻し | ||
pattern: 差戻し | ||
- expected: 行なう | ||
pattern: | ||
- 行う | ||
- おこなう | ||
- expected: 何卒 | ||
pattern: 何とぞ | ||
- expected: 並べ替え | ||
pattern: 並び替え | ||
- expected: 元$1 | ||
pattern: /もと([にへ])/ |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.