File tree Expand file tree Collapse file tree 2 files changed +6
-61
lines changed Expand file tree Collapse file tree 2 files changed +6
-61
lines changed Original file line number Diff line number Diff line change 1
- import _ from 'lodash' ;
2
1
import iterateJsdoc from '../iterateJsdoc' ;
3
2
4
3
export default iterateJsdoc ( ( {
@@ -18,28 +17,14 @@ export default iterateJsdoc(({
18
17
return ! line . trim ( ) . length ;
19
18
} ) ;
20
19
21
- const fix = ( fixer ) => {
22
- const replacement = sourceCode . getText ( jsdocNode ) . split ( '\n' )
23
- . map ( ( line , index ) => {
24
- // Ignore the first line and all lines not starting with `*`
25
- const ignored = ! index || line . split ( '*' ) [ 0 ] . trim ( ) . length ;
26
-
27
- return ignored ? line : indent + ' ' + _ . trimStart ( line ) ;
28
- } )
29
- . join ( '\n' ) ;
30
-
31
- return fixer . replaceText ( jsdocNode , replacement ) ;
32
- } ;
33
-
34
20
for ( const line of sourceLines ) {
35
21
if ( line . length !== indentLevel ) {
36
- report ( 'Expected JSDoc block to be aligned.' , fix ) ;
22
+ report ( 'Expected JSDoc block to be aligned.' ) ;
37
23
break ;
38
24
}
39
25
}
40
26
} , {
41
27
meta : {
42
- fixable : 'code' ,
43
28
type : 'layout'
44
29
}
45
30
} ) ;
Original file line number Diff line number Diff line change @@ -13,15 +13,7 @@ export default {
13
13
{
14
14
message : 'Expected JSDoc block to be aligned.'
15
15
}
16
- ] ,
17
- output : `
18
- /**
19
- * @param {Number} foo
20
- */
21
- function quux (foo) {
22
-
23
- }
24
- `
16
+ ]
25
17
} ,
26
18
{
27
19
code : `
@@ -36,15 +28,7 @@ export default {
36
28
{
37
29
message : 'Expected JSDoc block to be aligned.'
38
30
}
39
- ] ,
40
- output : `
41
- /**
42
- * @param {Number} foo
43
- */
44
- function quux (foo) {
45
-
46
- }
47
- `
31
+ ]
48
32
} ,
49
33
{
50
34
code : `
@@ -59,15 +43,7 @@ export default {
59
43
{
60
44
message : 'Expected JSDoc block to be aligned.'
61
45
}
62
- ] ,
63
- output : `
64
- /**
65
- * @param {Number} foo
66
- */
67
- function quux (foo) {
68
-
69
- }
70
- `
46
+ ]
71
47
} ,
72
48
{
73
49
code : `
@@ -82,15 +58,7 @@ export default {
82
58
{
83
59
message : 'Expected JSDoc block to be aligned.'
84
60
}
85
- ] ,
86
- output : `
87
- /**
88
- * @param {Number} foo
89
- */
90
- function quux (foo) {
91
-
92
- }
93
- `
61
+ ]
94
62
} ,
95
63
{
96
64
code : `
@@ -105,15 +73,7 @@ export default {
105
73
{
106
74
message : 'Expected JSDoc block to be aligned.'
107
75
}
108
- ] ,
109
- output : `
110
- /**
111
- * @param {Number} foo
112
- */
113
- function quux (foo) {
114
-
115
- }
116
- `
76
+ ]
117
77
}
118
78
] ,
119
79
valid : [
You can’t perform that action at this time.
0 commit comments