File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -63,8 +63,9 @@ textlint --rule no-doubled-joshi README.md
63
63
{
64
64
" rules" : {
65
65
" no-doubled-joshi" : {
66
- // 助詞のtoken同士の距離が2以下ならエラーにする
67
- " min_interval" : 2 ,
66
+ // 助詞のtoken同士の間隔値が1以下ならエラーにする
67
+ // 間隔値は1から開始されます
68
+ " min_interval" : 1 ,
68
69
// 例外を許可するかどうか
69
70
" strict" : false ,
70
71
// 助詞のうち「も」「や」は複数回の出現を許す
Original file line number Diff line number Diff line change @@ -111,7 +111,10 @@ export interface Options {
111
111
const report : TextlintRuleModule < Options > = function ( context , options = { } ) {
112
112
const helper = new RuleHelper ( context ) ;
113
113
// 最低間隔値
114
- const minInterval = options . min_interval || defaultOptions . min_interval ;
114
+ const minInterval = options . min_interval !== undefined ? options . min_interval : defaultOptions . min_interval ;
115
+ if ( minInterval <= 0 ) {
116
+ throw new Error ( "options.min_intervalは1以上の数値を指定してください" ) ;
117
+ }
115
118
const isStrict = options . strict || defaultOptions . strict ;
116
119
const allow = options . allow || defaultOptions . allow ;
117
120
const separatorCharacters = options . separatorCharacters || defaultOptions . separatorCharacters ;
You can’t perform that action at this time.
0 commit comments