Skip to content

Instantly share code, notes, and snippets.

@cu39
Last active January 13, 2017 05:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cu39/8999ef8d0794d47da30917aa9e287a6f to your computer and use it in GitHub Desktop.
Save cu39/8999ef8d0794d47da30917aa9e287a6f to your computer and use it in GitHub Desktop.
textlint-prh-regex-lookahead
node_modules/
{
"rules": {
"prh": {
"rulePaths": [
"./prh.yml"
]
}
}
}
const gulp = require('gulp');
const textlint = require('gulp-textlint');
gulp.task('textlint', function() {
return gulp.src('./test.md')
.pipe(textlint());
});
gulp.task('watch', function() {
gulp.watch('./**/*.md', ['textlint']);
});
gulp.task('default', ['watch']);
{
"name": "textlint-hands-on",
"version": "0.1.0",
"description": "textlint hands on",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "cu39",
"license": "ISC",
"devDependencies": {
"gulp": "^3.9.1",
"gulp-textlint": "^2.0.1",
"textlint-rule-prh": "^3.1.3"
},
"dependencies": {}
}
version: 1
rules:
- prh: 「行う」「行なう」は開く。
# textlint ログにレポートされる
# pattern: '/(おこな|行な?)([わいっうえお])/g'
# expected: おこな$2
# textlint ログにレポートされない
pattern: '/(おこな|行な?)(?=[わいっうえお])/g'
expected: おこな
specs:
- from: 行わない
to: おこなわない
- from: 行います
to: おこないます
- from: 行うとき
to: おこなうとき
- from: 行えば
to: おこなえば
- from: 行なう
to: おこなう
- from: おこなう
to: おこなう
# チェックされなくてよい部分
- from: 行く
to: 行く

textlint テスト用 Markdown

textlint をテストするためのマークダウン文書。

行う、行なう、おこなう。行って、行わない、行ないます。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment