@@ -24,7 +24,7 @@ export interface Options {
24
24
}
25
25
26
26
const rule : TextlintRuleModule < Options > = ( context , options = { } ) => {
27
- const { Syntax, report, locator } = context ;
27
+ const { Syntax, report, locator, RuleError } = context ;
28
28
const allows = options . allows ?? [ ] ;
29
29
const disableRedundancyGuidance = options . disableRedundancyGuidance ?? false ;
30
30
const disableVoiceGuidance = options . disableVoiceGuidance ?? false ;
@@ -233,10 +233,12 @@ const rule: TextlintRuleModule<Options> = (context, options = {}) => {
233
233
documentQualityMetrics [ category as keyof typeof documentQualityMetrics ] ++ ;
234
234
hasDocumentIssues = true ;
235
235
236
- report ( node , {
237
- message : message ,
238
- padding : locator . range ( originalRange )
239
- } ) ;
236
+ report (
237
+ node ,
238
+ new RuleError ( message , {
239
+ padding : locator . range ( originalRange )
240
+ } )
241
+ ) ;
240
242
}
241
243
}
242
244
}
@@ -266,9 +268,12 @@ const rule: TextlintRuleModule<Options> = (context, options = {}) => {
266
268
267
269
const detailsText = categoryDetails . length > 0 ? ` [内訳: ${ categoryDetails . join ( ", " ) } ]` : "" ;
268
270
269
- report ( node , {
270
- message : `【テクニカルライティング品質分析】この文書で${ totalIssues } 件の改善提案が見つかりました${ detailsText } 。効果的なテクニカルライティングの7つのC(Clear, Concise, Correct, Coherent, Concrete, Complete, Courteous)の原則に基づいて見直しを検討してください。詳細なガイドライン: https://github.com/textlint-ja/textlint-rule-preset-ai-writing/blob/main/docs/tech-writing-guidelines.md`
271
- } ) ;
271
+ report (
272
+ node ,
273
+ new RuleError (
274
+ `【テクニカルライティング品質分析】この文書で${ totalIssues } 件の改善提案が見つかりました${ detailsText } 。効果的なテクニカルライティングの7つのC(Clear, Concise, Correct, Coherent, Concrete, Complete, Courteous)の原則に基づいて見直しを検討してください。詳細なガイドライン: https://github.com/textlint-ja/textlint-rule-preset-ai-writing/blob/main/docs/tech-writing-guidelines.md`
275
+ )
276
+ ) ;
272
277
}
273
278
}
274
279
} ;
0 commit comments