File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -104,13 +104,17 @@ module.exports = {
104104 * @private
105105 */
106106 function getFixerFunction ( node , needed ) {
107- return function fix ( fixer ) {
108- const indent = Array ( needed + 1 ) . join ( indentChar ) ;
109- if ( node . type === 'JSXText' || node . type === 'Literal' ) {
107+ const indent = Array ( needed + 1 ) . join ( indentChar ) ;
108+
109+ if ( node . type === 'JSXText' || node . type === 'Literal' ) {
110+ return function fix ( fixer ) {
110111 const regExp = / \n [ \t ] * ( \S ) / g;
111112 const fixedText = node . raw . replace ( regExp , ( match , p1 ) => `\n${ indent } ${ p1 } ` ) ;
112113 return fixer . replaceText ( node , fixedText ) ;
113- }
114+ } ;
115+ }
116+
117+ return function fix ( fixer ) {
114118 return fixer . replaceTextRange (
115119 [ node . range [ 0 ] - node . loc . start . column , node . range [ 0 ] ] ,
116120 indent
You can’t perform that action at this time.
0 commit comments