File tree Expand file tree Collapse file tree 4 files changed +32
-4
lines changed Expand file tree Collapse file tree 4 files changed +32
-4
lines changed Original file line number Diff line number Diff line change 33{"gitdown": "contents", "rootId": "no-bad-blocks"}
44
55This rule checks for multi-line-style comments which fail to meet the
6- criteria of a jsdoc block, namely that it should begin with two and only two
7- asterisks, but which appear to be intended as jsdoc blocks due to the presence
6+ criteria of a JSDoc block, namely that it should begin with two and only two
7+ asterisks, but which appear to be intended as JSDoc blocks due to the presence
88of whitespace followed by whitespace or asterisks, and
99an at-sign (` @ ` ) and some non-whitespace (as with a jsdoc block tag).
1010
11+ Exceptions are made for ESLint directive comments (which may use ` @ ` in
12+ rule names).
13+
1114## Fixer
1215
1316(TODO)
Original file line number Diff line number Diff line change 55
66
77This rule checks for multi-line-style comments which fail to meet the
8- criteria of a jsdoc block, namely that it should begin with two and only two
9- asterisks, but which appear to be intended as jsdoc blocks due to the presence
8+ criteria of a JSDoc block, namely that it should begin with two and only two
9+ asterisks, but which appear to be intended as JSDoc blocks due to the presence
1010of whitespace followed by whitespace or asterisks, and
1111an at-sign (` @ ` ) and some non-whitespace (as with a jsdoc block tag).
1212
13+ Exceptions are made for ESLint directive comments (which may use ` @ ` in
14+ rule names).
15+
1316<a name =" user-content-fixer " ></a >
1417<a name =" fixer " ></a >
1518## Fixer
@@ -170,5 +173,7 @@ function quux (foo) {
170173}
171174
172175/***/
176+
177+ /* eslint-disable @stylistic/max-len */
173178````
174179
Original file line number Diff line number Diff line change @@ -31,6 +31,16 @@ export default iterateJsdoc(({
3131 allComments
3232 ) . filter ( ( comment ) => {
3333 const commentText = sourceCode . getText ( comment ) ;
34+
35+ const initialText = commentText . replace ( commentRegexp , '' ) . trimStart ( ) ;
36+ if ( [
37+ 'eslint'
38+ ] . some ( ( directive ) => {
39+ return initialText . startsWith ( directive ) ;
40+ } ) ) {
41+ return false ;
42+ }
43+
3444 let sliceIndex = 2 ;
3545 if ( ! commentRegexp . test ( commentText ) ) {
3646 const multiline = extraAsteriskCommentRegexp . exec ( commentText ) ?. [ 0 ] ;
Original file line number Diff line number Diff line change @@ -250,5 +250,15 @@ export default {
250250 {
251251 code : '/***/' ,
252252 } ,
253+ {
254+ code : '/* eslint-disable @stylistic/max-len */' ,
255+ plugins : {
256+ '@stylistic' : {
257+ rules : {
258+ 'max-len' : ( ) => { }
259+ }
260+ }
261+ } ,
262+ } ,
253263 ] ,
254264} ;
You can’t perform that action at this time.
0 commit comments