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