@@ -135,8 +135,8 @@ const get_translation = (text, block, node, options = {}) => {
135
135
block . transformed_code += dedented ;
136
136
translation . offsets = get_offsets ( text . slice ( 0 , node . start ) ) ;
137
137
translation . dedent = offsets ;
138
- const end = get_offsets ( block . transformed_code ) . lines ;
139
- for ( let i = translation . unoffsets . lines ; i <= end ; i ++ ) {
138
+ translation . end = get_offsets ( block . transformed_code ) . lines ;
139
+ for ( let i = translation . unoffsets . lines ; i <= translation . end ; i ++ ) {
140
140
block . translations . set ( i , translation ) ;
141
141
}
142
142
block . transformed_code += '\n' ;
@@ -313,15 +313,16 @@ const get_referenced_string = (block, message) => {
313
313
const get_identifier = str => ( str && str . match ( / ^ [ ^ \s ! " # % & \\ ' ( ) * + , \- . / : ; < = > ? @ [ \\ \] ^ ` { | } ~ ] + / ) || [ ] ) [ 0 ] ;
314
314
315
315
// determine whether this message from ESLint is something we care about
316
- const is_valid_message = ( block , message , { options } ) => {
316
+ const is_valid_message = ( block , message , translation ) => {
317
317
switch ( message . ruleId ) {
318
318
case 'eol-last' : return false ;
319
- case 'indent' : return ! options . template ;
319
+ case 'indent' : return ! translation . options . template ;
320
+ case 'linebreak-style' : return message . line !== translation . end ;
320
321
case 'no-labels' : return get_identifier ( get_referenced_string ( block , message ) ) !== '$' ;
321
322
case 'no-restricted-syntax' : return message . nodeType !== 'LabeledStatement' || get_identifier ( get_referenced_string ( block , message ) ) !== '$' ;
322
323
case 'no-self-assign' : return ! var_names . has ( get_identifier ( get_referenced_string ( block , message ) ) ) ;
323
324
case 'no-unused-labels' : return get_referenced_string ( block , message ) !== '$' ;
324
- case 'quotes' : return ! options . in_quoted_attribute ;
325
+ case 'quotes' : return ! translation . options . in_quoted_attribute ;
325
326
}
326
327
return true ;
327
328
} ;
0 commit comments