@@ -566,21 +566,16 @@ module.exports.transformForLint = function transformForLint(code) {
566
566
*/
567
567
const result = processor . parse ( code ) ;
568
568
for ( const tplInfo of result . reverse ( ) ) {
569
- const specialChars = [ ...tplInfo . contents ] . reduce (
570
- ( prev , curr ) => ( prev + [ '`' , '$' ] . includes ( curr . codePointAt ( 0 ) ) ? 1 : 0 ) ,
571
- 0
572
- ) ;
573
569
const content = tplInfo . contents . replace ( / ` / g, '\\`' ) . replace ( / \$ / g, '\\$' ) ;
574
570
if ( tplInfo . type === 'class-member' ) {
575
571
const tplLength = tplInfo . range . end - tplInfo . range . start ;
576
- const spaces =
577
- tplLength - byteLength ( content ) - 'static{`' . length - '`}' . length - specialChars ;
572
+ const spaces = tplLength - byteLength ( content ) - 'static{`' . length - '`}' . length ;
578
573
const total = content + ' ' . repeat ( spaces ) ;
579
574
const replacementCode = `static{\`${ total } \`}` ;
580
575
jsCode = replaceRange ( jsCode , tplInfo . range . start , tplInfo . range . end , replacementCode ) ;
581
576
} else {
582
577
const tplLength = tplInfo . range . end - tplInfo . range . start ;
583
- const spaces = tplLength - byteLength ( content ) - '`' . length - '`' . length - specialChars ;
578
+ const spaces = tplLength - byteLength ( content ) - '`' . length - '`' . length ;
584
579
const total = content + ' ' . repeat ( spaces ) ;
585
580
const replacementCode = `\`${ total } \`` ;
586
581
jsCode = replaceRange ( jsCode , tplInfo . range . start , tplInfo . range . end , replacementCode ) ;
0 commit comments