@@ -14,7 +14,6 @@ const reporter = (context, options) => {
1414 throw new Error ( `Require options: { "configFile": "path/to/.eslintrc" }` ) ;
1515 }
1616 const availableLang = options . langs || defaultOptions . langs ;
17- const filePath = context . getFilePath ( ) ;
1817 const textlintRcFilePath = context . config ? context . config . configFile : null ;
1918 const textlintRCDir = textlintRcFilePath ? path . dirname ( textlintRcFilePath ) : process . cwd ( ) ;
2019 const ESLintOptions = {
@@ -43,18 +42,19 @@ const reporter = (context, options) => {
4342
4443 ESLint message line and column start with 1
4544 */
45+ const prefix = message . ruleId ? `${ message . ruleId } : ` : "" ;
4646 if ( message . fix ) {
4747 const paddingIndex = raw . indexOf ( code ) ;
4848 const fixedRange = message . fix . range ;
4949 const fixedText = message . fix . text ;
5050 const fixedWithPadding = [ fixedRange [ 0 ] + paddingIndex , fixedRange [ 1 ] + paddingIndex ] ;
51- report ( node , new RuleError ( `${ message . ruleId } : ${ message . message } ` , {
51+ report ( node , new RuleError ( `${ prefix } ${ message . message } ` , {
5252 line : message . line ,
5353 column : message . column - 1 ,
5454 fix : fixer . replaceTextRange ( fixedWithPadding , fixedText )
5555 } ) ) ;
5656 } else {
57- report ( node , new RuleError ( `${ message . ruleId } : ${ message . message } ` , {
57+ report ( node , new RuleError ( `${ prefix } ${ message . message } ` , {
5858 line : message . line ,
5959 column : message . column - 1
6060 } ) ) ;
0 commit comments