Skip to content

Commit 59673c4

Browse files
committed
fix: add settings (fixes #75)
1 parent 83ff68f commit 59673c4

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ function quux (foo = 'FOO') {
201201
function quux (foo = 'FOO') {
202202

203203
}
204+
// Settings: {"jsdoc":{"tagNamePreference":{"param":"arg"}}}
204205
// Message: Expected @arg names to be "foo". Got "Foo".
205206

206207
/**
@@ -442,6 +443,7 @@ function quux (foo) {
442443
function quux (foo) {
443444

444445
}
446+
// Settings: {"jsdoc":{"tagNamePreference":{"param":"arg"}}}
445447
// Message: Invalid JSDoc tag (preference). Replace "param" JSDoc tag with "arg".
446448

447449
/**
@@ -458,6 +460,7 @@ function quux (foo) {
458460
function quux (foo) {
459461

460462
}
463+
// Settings: {"jsdoc":{"additionalTagNames":{"customTags":["bar"]}}}
461464
// Message: Invalid JSDoc tag name "baz".
462465

463466
/**
@@ -467,6 +470,7 @@ function quux (foo) {
467470
function quux (foo) {
468471

469472
}
473+
// Settings: {"jsdoc":{"additionalTagNames":{"customTags":["bar"]}}}
470474
// Message: Invalid JSDoc tag name "baz".
471475
```
472476

@@ -486,20 +490,23 @@ function quux (foo) {
486490
function quux (foo) {
487491

488492
}
493+
// Settings: {"jsdoc":{"tagNamePreference":{"param":"arg"}}}
489494

490495
/**
491496
* @bar foo
492497
*/
493498
function quux (foo) {
494499

495500
}
501+
// Settings: {"jsdoc":{"additionalTagNames":{"customTags":["bar"]}}}
496502

497503
/**
498504
* @baz @bar foo
499505
*/
500506
function quux (foo) {
501507

502508
}
509+
// Settings: {"jsdoc":{"additionalTagNames":{"customTags":["baz","bar"]}}}
503510

504511
/**
505512
* @abstract
@@ -1250,6 +1257,7 @@ function quux (foo) {
12501257
function quux (foo) {
12511258

12521259
}
1260+
// Settings: {"jsdoc":{"tagNamePreference":{"param":"arg"}}}
12531261
// Message: Missing JSDoc @arg "foo" declaration.
12541262

12551263
/**
@@ -1292,6 +1300,7 @@ function quux (foo) {
12921300
function quux (foo) {
12931301

12941302
}
1303+
// Settings: {"jsdoc":{"tagNamePreference":{"param":"arg"}}}
12951304

12961305
/**
12971306
* @override
@@ -1307,6 +1316,7 @@ function quux (foo) {
13071316
function quux (foo) {
13081317

13091318
}
1319+
// Settings: {"jsdoc":{"allowOverrideWithoutParam":true}}
13101320
```
13111321

13121322

@@ -1337,6 +1347,7 @@ function quux (foo) {
13371347
function quux (foo) {
13381348

13391349
}
1350+
// Settings: {"jsdoc":{"tagNamePreference":{"param":"arg"}}}
13401351
// Message: Missing JSDoc @arg "foo" description.
13411352
```
13421353

@@ -1439,6 +1450,7 @@ function quux (foo) {
14391450
function quux (foo) {
14401451

14411452
}
1453+
// Settings: {"jsdoc":{"tagNamePreference":{"param":"arg"}}}
14421454
// Message: Missing JSDoc @arg "foo" type.
14431455
```
14441456

@@ -1488,6 +1500,7 @@ function quux (foo) {
14881500
function quux (foo) {
14891501

14901502
}
1503+
// Settings: {"jsdoc":{"tagNamePreference":{"returns":"return"}}}
14911504
// Message: Missing JSDoc @return description.
14921505
```
14931506

@@ -1545,6 +1558,7 @@ function quux () {
15451558
function quux () {
15461559

15471560
}
1561+
// Settings: {"jsdoc":{"tagNamePreference":{"returns":"return"}}}
15481562
// Message: Missing JSDoc @return type.
15491563
```
15501564

bin/readme-assertions.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ const formatCodeSnippet = (setup) => {
1111

1212
paragraphs.push(trimCode(setup.code));
1313

14+
if (setup.settings) {
15+
paragraphs.push('// Settings: ' + JSON.stringify(setup.settings));
16+
}
17+
1418
if (setup.options) {
1519
paragraphs.push('// Options: ' + JSON.stringify(setup.options));
1620
}

0 commit comments

Comments
 (0)