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' ;
21import iterateJsdoc from '../iterateJsdoc' ;
32
43export default iterateJsdoc ( ( {
@@ -18,28 +17,14 @@ export default iterateJsdoc(({
1817 return ! line . trim ( ) . length ;
1918 } ) ;
2019
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-
3420 for ( const line of sourceLines ) {
3521 if ( line . length !== indentLevel ) {
36- report ( 'Expected JSDoc block to be aligned.' , fix ) ;
22+ report ( 'Expected JSDoc block to be aligned.' ) ;
3723 break ;
3824 }
3925 }
4026} , {
4127 meta : {
42- fixable : 'code' ,
4328 type : 'layout'
4429 }
4530} ) ;
Original file line number Diff line number Diff line change @@ -13,15 +13,7 @@ export default {
1313 {
1414 message : 'Expected JSDoc block to be aligned.'
1515 }
16- ] ,
17- output : `
18- /**
19- * @param {Number} foo
20- */
21- function quux (foo) {
22-
23- }
24- `
16+ ]
2517 } ,
2618 {
2719 code : `
@@ -36,15 +28,7 @@ export default {
3628 {
3729 message : 'Expected JSDoc block to be aligned.'
3830 }
39- ] ,
40- output : `
41- /**
42- * @param {Number} foo
43- */
44- function quux (foo) {
45-
46- }
47- `
31+ ]
4832 } ,
4933 {
5034 code : `
@@ -59,15 +43,7 @@ export default {
5943 {
6044 message : 'Expected JSDoc block to be aligned.'
6145 }
62- ] ,
63- output : `
64- /**
65- * @param {Number} foo
66- */
67- function quux (foo) {
68-
69- }
70- `
46+ ]
7147 } ,
7248 {
7349 code : `
@@ -82,15 +58,7 @@ export default {
8258 {
8359 message : 'Expected JSDoc block to be aligned.'
8460 }
85- ] ,
86- output : `
87- /**
88- * @param {Number} foo
89- */
90- function quux (foo) {
91-
92- }
93- `
61+ ]
9462 } ,
9563 {
9664 code : `
@@ -105,15 +73,7 @@ export default {
10573 {
10674 message : 'Expected JSDoc block to be aligned.'
10775 }
108- ] ,
109- output : `
110- /**
111- * @param {Number} foo
112- */
113- function quux (foo) {
114-
115- }
116- `
76+ ]
11777 }
11878 ] ,
11979 valid : [
You can’t perform that action at this time.
0 commit comments