@@ -17,6 +17,7 @@ JSDoc linting rules for ESLint.
17
17
* [ Allow ` @override ` Without Accompanying ` @param ` Tags] ( #eslint-plugin-jsdoc-settings-allow-override-without-accompanying-param-tags )
18
18
* [ Settings to Configure ` check-examples ` ] ( #eslint-plugin-jsdoc-settings-settings-to-configure-check-examples )
19
19
* [ Rules] ( #eslint-plugin-jsdoc-rules )
20
+ * [ ` check-alignment ` ] ( #eslint-plugin-jsdoc-rules-check-alignment )
20
21
* [ ` check-examples ` ] ( #eslint-plugin-jsdoc-rules-check-examples )
21
22
* [ ` check-param-names ` ] ( #eslint-plugin-jsdoc-rules-check-param-names )
22
23
* [ ` check-tag-names ` ] ( #eslint-plugin-jsdoc-rules-check-tag-names )
@@ -45,6 +46,7 @@ This table maps the rules between `eslint-plugin-jsdoc` and `jscs-jsdoc`.
45
46
46
47
| ` eslint-plugin-jsdoc ` | ` jscs-jsdoc ` |
47
48
| --- | --- |
49
+ | [ ` check-alignment ` ] ( https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-check-alignment ) | N/A |
48
50
| [ ` check-examples ` ] ( https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-check-examples ) | N/A |
49
51
| [ ` check-param-names ` ] ( https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-check-param-names ) | [ ` checkParamNames ` ] ( https://github.com/jscs-dev/jscs-jsdoc#checkparamnames ) |
50
52
| [ ` check-tag-names ` ] ( https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-check-tag-names ) | N/A ~ [ ` checkAnnotations ` ] ( https://github.com/jscs-dev/jscs-jsdoc#checkannotations ) |
@@ -104,6 +106,7 @@ Finally, enable all of the rules that you would like to use.
104
106
``` json
105
107
{
106
108
"rules" : {
109
+ "jsdoc/check-alignment" : 1 ,
107
110
"jsdoc/check-examples" : 1 ,
108
111
"jsdoc/check-param-names" : 1 ,
109
112
"jsdoc/check-tag-names" : 1 ,
@@ -285,6 +288,87 @@ Finally, the following rule pertains to inline disable directives:
285
288
<a name =" eslint-plugin-jsdoc-rules " ></a >
286
289
## Rules
287
290
291
+ <a name =" eslint-plugin-jsdoc-rules-check-alignment " ></a >
292
+ ### <code >check-alignment</code >
293
+
294
+ Reports invalid alignment of JSDoc block asterisks.
295
+
296
+ |||
297
+ | ---| ---|
298
+ | Context| ` ArrowFunctionExpression ` , ` FunctionDeclaration ` , ` FunctionExpression ` |
299
+ | Tags| N/A|
300
+
301
+ The following patterns are considered problems:
302
+
303
+ ```` js
304
+ /**
305
+ * @param {Number} foo
306
+ */
307
+ function quux (foo ) {
308
+
309
+ }
310
+ // Message: Expected JSDoc block to be aligned.
311
+
312
+ /**
313
+ * @param {Number} foo
314
+ */
315
+ function quux (foo ) {
316
+
317
+ }
318
+ // Message: Expected JSDoc block to be aligned.
319
+
320
+ /**
321
+ * @param {Number} foo
322
+ */
323
+ function quux (foo ) {
324
+
325
+ }
326
+ // Message: Expected JSDoc block to be aligned.
327
+
328
+ /**
329
+ * @param {Number} foo
330
+ */
331
+ function quux (foo ) {
332
+
333
+ }
334
+ // Message: Expected JSDoc block to be aligned.
335
+
336
+ /**
337
+ * @param {Number} foo
338
+ */
339
+ function quux (foo ) {
340
+
341
+ }
342
+ // Message: Expected JSDoc block to be aligned.
343
+ ````
344
+
345
+ The following patterns are not considered problems:
346
+
347
+ ```` js
348
+ /**
349
+ * Desc
350
+ *
351
+ * @param {Number} foo
352
+ */
353
+ function quux (foo ) {
354
+
355
+ }
356
+
357
+ /**
358
+ * Desc
359
+ *
360
+ * @param {{
361
+ foo: Bar,
362
+ bar: Baz
363
+ * }} foo
364
+ *
365
+ */
366
+ function quux (foo ) {
367
+
368
+ }
369
+ ````
370
+
371
+
288
372
<a name =" eslint-plugin-jsdoc-rules-check-examples " ></a >
289
373
### <code >check-examples</code >
290
374
0 commit comments