Skip to content

Commit 55bbc93

Browse files
authored
feat(rule): allowNodeTypes オプションを追加 (#13)
* chore(deps): add prettier * fix(rule): support skipNodeTypes and fix list bug fix #1 fix #5 * fix typo * chore(README): add `skipNodeTypes`
1 parent c7d9277 commit 55bbc93

File tree

8 files changed

+2802
-1575
lines changed

8 files changed

+2802
-1575
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ Via CLI
4141

4242
textlint --rule ja-no-redundant-expression README.md
4343

44+
## Options
45+
46+
- `allowNodeTypes`: `string[]`
47+
- 無視したいNode typeを配列で指定
48+
- Node typeは <https://textlint.github.io/docs/txtnode.html#type> を参照
49+
- デフォルトでは、`["BlockQuote", "Link", "ReferenceDef"]`を指定し、引用やリンクのテキストは無視する
50+
4451
## Changelog
4552

4653
See [Releases page](https://github.com/textlint-ja/textlint-rule-ja-no-redundant-expression/releases).

package.json

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
"docs": "node tools/update-readme.js",
1919
"prepublish": "npm run docs && npm run --if-present build",
2020
"build": "textlint-scripts build",
21-
"watch": "textlint-scripts build --watch"
21+
"watch": "textlint-scripts build --watch",
22+
"prettier": "prettier --write \"**/*.{js,jsx,ts,tsx,css}\""
2223
},
2324
"repository": {
2425
"type": "git",
@@ -30,14 +31,35 @@
3031
"homepage": "https://github.com/textlint-ja/textlint-rule-ja-no-redundant-expression",
3132
"devDependencies": {
3233
"add-text-to-markdown": "^2.0.0",
33-
"textlint-scripts": "^1.2.2"
34+
"husky": "^1.3.1",
35+
"lint-staged": "^8.1.0",
36+
"prettier": "^1.15.3",
37+
"textlint-scripts": "^2.1.0"
3438
},
3539
"dependencies": {
3640
"kuromojin": "^1.3.2",
3741
"morpheme-match": "^1.2.1",
38-
"morpheme-match-all": "^1.2.0"
42+
"morpheme-match-all": "^1.2.0",
43+
"textlint-rule-helper": "^2.1.1",
44+
"textlint-util-to-string": "^2.1.1"
3945
},
4046
"keywords": [
4147
"textlintrule"
42-
]
48+
],
49+
"prettier": {
50+
"singleQuote": false,
51+
"printWidth": 120,
52+
"tabWidth": 4
53+
},
54+
"husky": {
55+
"hooks": {
56+
"precommit": "lint-staged"
57+
}
58+
},
59+
"lint-staged": {
60+
"*.{js,jsx,ts,tsx,css}": [
61+
"prettier --write",
62+
"git add"
63+
]
64+
}
4365
}

0 commit comments

Comments
 (0)