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 = {
104
104
* @private
105
105
*/
106
106
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 ) {
110
111
const regExp = / \n [ \t ] * ( \S ) / g;
111
112
const fixedText = node . raw . replace ( regExp , ( match , p1 ) => `\n${ indent } ${ p1 } ` ) ;
112
113
return fixer . replaceText ( node , fixedText ) ;
113
- }
114
+ } ;
115
+ }
116
+
117
+ return function fix ( fixer ) {
114
118
return fixer . replaceTextRange (
115
119
[ node . range [ 0 ] - node . loc . start . column , node . range [ 0 ] ] ,
116
120
indent
You can’t perform that action at this time.
0 commit comments