File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,9 @@ const pragmaUtil = require('../util/pragma');
7
7
const jsxUtil = require ( '../util/jsx' ) ;
8
8
const docsUrl = require ( '../util/docsUrl' ) ;
9
9
10
+ function isJSXText ( node ) {
11
+ return ! ! node && ( node . type === 'JSXText' || node . type === 'Literal' ) ;
12
+ }
10
13
11
14
module . exports = {
12
15
meta : {
@@ -34,7 +37,7 @@ module.exports = {
34
37
* @returns {boolean }
35
38
*/
36
39
function isPaddingSpaces ( node ) {
37
- return ( node . type === 'JSXText' || node . type === 'Literal' )
40
+ return isJSXText ( node )
38
41
&& / ^ \s * $ / . test ( node . raw )
39
42
&& node . raw . includes ( '\n' ) ;
40
43
}
@@ -65,10 +68,6 @@ module.exports = {
65
68
&& / ^ [ a - z ] + $ / . test ( node . parent . openingElement . name . name ) ;
66
69
}
67
70
68
- function isJSXText ( node ) {
69
- return ! ! node && ( node . type === 'JSXText' || node . type === 'Literal' ) ;
70
- }
71
-
72
71
/**
73
72
* Avoid fixing case like:
74
73
* ```jsx
You can’t perform that action at this time.
0 commit comments