Skip to content
This repository was archived by the owner on Jan 20, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Lint
on: [pull_request]
jobs:
textlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: textlint
uses: tsuyoshicho/action-textlint@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-check
textlint_flags: "docs/**/*.md"
5 changes: 0 additions & 5 deletions .huskyrc.js

This file was deleted.

31 changes: 31 additions & 0 deletions .textlintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Collection of textlint rule
// https://github.com/textlint/textlint/wiki/Collection-of-textlint-rule

module.exports = {
rules: {
// https://github.com/textlint-ja/textlint-rule-preset-ja-technical-writing
"preset-ja-technical-writing": true,
// https://github.com/textlint-ja/textlint-rule-preset-JTF-style
"preset-jtf-style": {
"1.1.3.箇条書き": false, // 箇条書きの文末に句点(。)以外を許可
"3.1.1.全角文字と半角文字の間": false, // 全角文字と半角文字の間にスペースを入れる
"4.2.7.コロン(:)": false, // 半角コロンを許可
},
// https://github.com/textlint-rule/textlint-rule-prh
prh: { rulePaths: ["./prh.yml"] },
"ja-technical-writing/no-exclamation-question-mark": false, // 文末の感嘆符を許可
"ja-technical-writing/sentence-length": false, // 翻訳完了後に有効化
"ja-technical-writing/max-comma": false, // 翻訳完了後に有効化
"textlint-rule-ja-hiragana-hojodoushi": true,
"textlint-rule-ja-hiragana-fukushi": true,
"textlint-rule-ja-hiragana-keishikimeishi": true,
},
filters: {
// https://github.com/textlint/textlint-filter-rule-comments
comments: true,
// https://github.com/textlint/textlint-filter-rule-whitelist
whitelist: {
allow: ["/^<[\\s\\S]*?/>/m"], // Reactコンポーネントをlintしない
},
},
}
29 changes: 26 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,30 @@
{
"scripts": {
"lint": "textlint docs/**/*.md -f pretty-error",
"format": "pretty-quick && textlint docs/**/*.md --fix"
},
"devDependencies": {
"husky": "^3.0.9",
"prettier": "1.18.2",
"pretty-quick": "^2.0.0"
"husky": "^4.0.7",
"lint-staged": "^9.5.0",
"prettier": "1.19.1",
"pretty-quick": "^2.0.1",
"textlint": "^11.6.1",
"textlint-filter-rule-comments": "^1.2.2",
"textlint-filter-rule-whitelist": "^2.0.0",
"textlint-rule-ja-hiragana-fukushi": "^1.2.0",
"textlint-rule-ja-hiragana-hojodoushi": "^1.0.4",
"textlint-rule-ja-hiragana-keishikimeishi": "^1.0.2",
"textlint-rule-preset-ja-technical-writing": "^4.0.0-beta.0",
"textlint-rule-preset-jtf-style": "^2.3.4"
},
"husky": {
"hooks": {
"pre-commit": "pretty-quick --staged && lint-staged"
}
},
"lint-staged": {
"*.md": [
"textlint"
]
}
}
6 changes: 6 additions & 0 deletions prh.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 1
rules:
- expected: エキスパート
pattern: エクスパート
- expected: ユーザー
pattern: /ユーザ(?!ー)/
Loading