File tree Expand file tree Collapse file tree 3 files changed +19
-29
lines changed Expand file tree Collapse file tree 3 files changed +19
-29
lines changed Original file line number Diff line number Diff line change 4
4
*/
5
5
'use strict' ;
6
6
7
+ var getTokenBeforeClosingBracket = require ( '../util/getTokenBeforeClosingBracket' ) ;
8
+
7
9
// ------------------------------------------------------------------------------
8
10
// Rule Definition
9
11
// ------------------------------------------------------------------------------
@@ -30,19 +32,6 @@ module.exports = {
30
32
var NEVER_MESSAGE = 'A space is forbidden before closing bracket' ;
31
33
var ALWAYS_MESSAGE = 'A space is required before closing bracket' ;
32
34
33
- /**
34
- * Find the token before the closing bracket.
35
- * @param {ASTNode } node - The JSX element node.
36
- * @returns {Token } The token before the closing bracket.
37
- */
38
- function getTokenBeforeClosingBracket ( node ) {
39
- var attributes = node . attributes ;
40
- if ( attributes . length === 0 ) {
41
- return node . name ;
42
- }
43
- return attributes [ attributes . length - 1 ] ;
44
- }
45
-
46
35
// --------------------------------------------------------------------------
47
36
// Public
48
37
// --------------------------------------------------------------------------
Original file line number Diff line number Diff line change 4
4
*/
5
5
'use strict' ;
6
6
7
- // ------------------------------------------------------------------------------
8
- // Helpers
9
- // ------------------------------------------------------------------------------
10
-
11
- /**
12
- * Find the token before the closing bracket.
13
- * @param {ASTNode } node - The JSX element node.
14
- * @returns {Token } The token before the closing bracket.
15
- */
16
- function getTokenBeforeClosingBracket ( node ) {
17
- var attributes = node . attributes ;
18
- if ( attributes . length === 0 ) {
19
- return node . name ;
20
- }
21
- return attributes [ attributes . length - 1 ] ;
22
- }
7
+ var getTokenBeforeClosingBracket = require ( '../util/getTokenBeforeClosingBracket' ) ;
23
8
24
9
// ------------------------------------------------------------------------------
25
10
// Validators
Original file line number Diff line number Diff line change
1
+ 'use strict' ;
2
+
3
+ /**
4
+ * Find the token before the closing bracket.
5
+ * @param {ASTNode } node - The JSX element node.
6
+ * @returns {Token } The token before the closing bracket.
7
+ */
8
+ function getTokenBeforeClosingBracket ( node ) {
9
+ var attributes = node . attributes ;
10
+ if ( attributes . length === 0 ) {
11
+ return node . name ;
12
+ }
13
+ return attributes [ attributes . length - 1 ] ;
14
+ }
15
+
16
+ module . exports = getTokenBeforeClosingBracket ;
You can’t perform that action at this time.
0 commit comments