Skip to content

Commit

Permalink
fix: add settings (fixes #75)
Browse files Browse the repository at this point in the history
  • Loading branch information
gajus committed May 22, 2018
1 parent 83ff68f commit 59673c4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Expand Up @@ -201,6 +201,7 @@ function quux (foo = 'FOO') {
function quux (foo = 'FOO') {

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

/**
Expand Down Expand Up @@ -442,6 +443,7 @@ function quux (foo) {
function quux (foo) {

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

/**
Expand All @@ -458,6 +460,7 @@ function quux (foo) {
function quux (foo) {

}
// Settings: {"jsdoc":{"additionalTagNames":{"customTags":["bar"]}}}
// Message: Invalid JSDoc tag name "baz".

/**
Expand All @@ -467,6 +470,7 @@ function quux (foo) {
function quux (foo) {

}
// Settings: {"jsdoc":{"additionalTagNames":{"customTags":["bar"]}}}
// Message: Invalid JSDoc tag name "baz".
```

Expand All @@ -486,20 +490,23 @@ function quux (foo) {
function quux (foo) {

}
// Settings: {"jsdoc":{"tagNamePreference":{"param":"arg"}}}

/**
* @bar foo
*/
function quux (foo) {

}
// Settings: {"jsdoc":{"additionalTagNames":{"customTags":["bar"]}}}

/**
* @baz @bar foo
*/
function quux (foo) {

}
// Settings: {"jsdoc":{"additionalTagNames":{"customTags":["baz","bar"]}}}

/**
* @abstract
Expand Down Expand Up @@ -1250,6 +1257,7 @@ function quux (foo) {
function quux (foo) {

}
// Settings: {"jsdoc":{"tagNamePreference":{"param":"arg"}}}
// Message: Missing JSDoc @arg "foo" declaration.

/**
Expand Down Expand Up @@ -1292,6 +1300,7 @@ function quux (foo) {
function quux (foo) {

}
// Settings: {"jsdoc":{"tagNamePreference":{"param":"arg"}}}

/**
* @override
Expand All @@ -1307,6 +1316,7 @@ function quux (foo) {
function quux (foo) {

}
// Settings: {"jsdoc":{"allowOverrideWithoutParam":true}}
```


Expand Down Expand Up @@ -1337,6 +1347,7 @@ function quux (foo) {
function quux (foo) {

}
// Settings: {"jsdoc":{"tagNamePreference":{"param":"arg"}}}
// Message: Missing JSDoc @arg "foo" description.
```

Expand Down Expand Up @@ -1439,6 +1450,7 @@ function quux (foo) {
function quux (foo) {

}
// Settings: {"jsdoc":{"tagNamePreference":{"param":"arg"}}}
// Message: Missing JSDoc @arg "foo" type.
```

Expand Down Expand Up @@ -1488,6 +1500,7 @@ function quux (foo) {
function quux (foo) {

}
// Settings: {"jsdoc":{"tagNamePreference":{"returns":"return"}}}
// Message: Missing JSDoc @return description.
```

Expand Down Expand Up @@ -1545,6 +1558,7 @@ function quux () {
function quux () {

}
// Settings: {"jsdoc":{"tagNamePreference":{"returns":"return"}}}
// Message: Missing JSDoc @return type.
```

Expand Down
4 changes: 4 additions & 0 deletions bin/readme-assertions.js
Expand Up @@ -11,6 +11,10 @@ const formatCodeSnippet = (setup) => {

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

if (setup.settings) {
paragraphs.push('// Settings: ' + JSON.stringify(setup.settings));
}

if (setup.options) {
paragraphs.push('// Options: ' + JSON.stringify(setup.options));
}
Expand Down

0 comments on commit 59673c4

Please sign in to comment.