@@ -89,8 +89,12 @@ var NoUnexternalizedStringsRuleWalker = (function (_super) {
8989 if ( functionName && this . ignores [ functionName ] ) {
9090 return ;
9191 }
92+ var x = "foo" ;
9293 if ( doubleQuoted && ( ! callInfo || callInfo . argIndex === - 1 || ! this . signatures [ functionName ] ) ) {
93- this . addFailure ( this . createFailure ( node . getStart ( ) , node . getWidth ( ) , "Unexternalized string found: " + node . getText ( ) ) ) ;
94+ var s = node . getText ( ) ;
95+ var replacement = new Lint . Replacement ( node . getStart ( ) , node . getWidth ( ) , "nls.localize('KEY-" + s . substring ( 1 , s . length - 1 ) + "', " + s + ")" ) ;
96+ var fix = new Lint . Fix ( "Unexternalitzed string" , [ replacement ] ) ;
97+ this . addFailure ( this . createFailure ( node . getStart ( ) , node . getWidth ( ) , "Unexternalized string found: " + node . getText ( ) , fix ) ) ;
9498 return ;
9599 }
96100 // We have a single quoted string outside a localize function name.
@@ -109,8 +113,8 @@ var NoUnexternalizedStringsRuleWalker = (function (_super) {
109113 for ( var i = 0 ; i < keyArg . properties . length ; i ++ ) {
110114 var property = keyArg . properties [ i ] ;
111115 if ( isPropertyAssignment ( property ) ) {
112- var name_1 = property . name . getText ( ) ;
113- if ( name_1 === 'key' ) {
116+ var name = property . name . getText ( ) ;
117+ if ( name === 'key' ) {
114118 var initializer = property . initializer ;
115119 if ( isStringLiteral ( initializer ) ) {
116120 this . recordKey ( initializer , this . messageIndex ? callInfo . callExpression . arguments [ this . messageIndex ] : undefined ) ;
0 commit comments