Skip to content

Commit 634f1d9

Browse files
committed
Include options and error messages in the documentation examples.
1 parent 852352a commit 634f1d9

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,6 @@ This rule takes one argument. If it is `"always"` then a problem is raised when
476476
The following patterns are considered problems:
477477

478478
```js
479-
// Options: ["always"]
480479
/**
481480
* Foo.
482481
*
@@ -486,9 +485,9 @@ The following patterns are considered problems:
486485
function quux () {
487486

488487
}
488+
// Options: ["always"]
489489
// Message: There must be a newline after the description of the JSDoc block.
490490

491-
// Options: ["never"]
492491
/**
493492
* Bar.
494493
*
@@ -499,29 +498,29 @@ function quux () {
499498
function quux () {
500499

501500
}
501+
// Options: ["never"]
502502
// Message: There must be no newline after the description of the JSDoc block.
503503
```
504504

505505
The following patterns are not considered problems:
506506

507507
```js
508-
// Options: ["always"]
509508
/**
510509
* Foo.
511510
*/
512511
function quux () {
513512

514513
}
514+
// Options: ["always"]
515515

516-
// Options: ["never"]
517516
/**
518517
* Bar.
519518
*/
520519
function quux () {
521520

522521
}
522+
// Options: ["never"]
523523

524-
// Options: ["always"]
525524
/**
526525
* Foo.
527526
*
@@ -530,15 +529,16 @@ function quux () {
530529
function quux () {
531530

532531
}
532+
// Options: ["always"]
533533

534-
// Options: ["never"]
535534
/**
536535
* Bar.
537536
* @bar
538537
*/
539538
function quux () {
540539

541540
}
541+
// Options: ["never"]
542542
```
543543

544544

bin/readme-assertions.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ import fs from 'fs';
99
const formatCodeSnippet = (setup) => {
1010
const paragraphs = [];
1111

12+
paragraphs.push(trimCode(setup.code));
13+
1214
if (setup.options) {
1315
paragraphs.push('// Options: ' + JSON.stringify(setup.options));
1416
}
1517

16-
paragraphs.push(trimCode(setup.code));
17-
1818
if (setup.errors) {
1919
paragraphs.push('// Message: ' + setup.errors[0].message);
2020
}

0 commit comments

Comments
 (0)