Skip to content

Commit 36f6f9c

Browse files
committed
test: demo disabling param tags with name props
1 parent beb169c commit 36f6f9c

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14850,6 +14850,15 @@ function quux (foo) {
1485014850
}
1485114851
// Settings: {"jsdoc":{"tagNamePreference":{"param":false}}}
1485214852
// Message: Unexpected tag `@param`
14853+
14854+
/**
14855+
* @param foo
14856+
*/
14857+
function quux (foo) {
14858+
14859+
}
14860+
// "jsdoc/require-param-description": ["error"|"warn", {"contexts":[{"comment":"JsdocBlock:has(JsdocTag:not([name=props]))","context":"FunctionDeclaration"}]}]
14861+
// Message: Missing JSDoc @param "foo" description.
1485314862
````
1485414863

1485514864
The following patterns are not considered problems:
@@ -14886,6 +14895,14 @@ function quux (foo) {
1488614895
* @callback
1488714896
* @param foo
1488814897
*/
14898+
14899+
/**
14900+
* @param props
14901+
*/
14902+
function quux (props) {
14903+
14904+
}
14905+
// "jsdoc/require-param-description": ["error"|"warn", {"contexts":[{"comment":"JsdocBlock:has(JsdocTag:not([name=props]))","context":"FunctionDeclaration"}]}]
1488914906
````
1489014907

1489114908

test/rules/assertions/requireParamDescription.js

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,32 @@ export default {
127127
},
128128
},
129129
},
130+
{
131+
code: `
132+
/**
133+
* @param foo
134+
*/
135+
function quux (foo) {
136+
137+
}
138+
`,
139+
errors: [
140+
{
141+
line: 3,
142+
message: 'Missing JSDoc @param "foo" description.',
143+
},
144+
],
145+
options: [
146+
{
147+
contexts: [
148+
{
149+
comment: 'JsdocBlock:has(JsdocTag:not([name=props]))',
150+
context: 'FunctionDeclaration',
151+
},
152+
],
153+
},
154+
],
155+
},
130156
],
131157
valid: [
132158
{
@@ -196,5 +222,25 @@ export default {
196222
`,
197223
ignoreReadme: true,
198224
},
225+
{
226+
code: `
227+
/**
228+
* @param props
229+
*/
230+
function quux (props) {
231+
232+
}
233+
`,
234+
options: [
235+
{
236+
contexts: [
237+
{
238+
comment: 'JsdocBlock:has(JsdocTag:not([name=props]))',
239+
context: 'FunctionDeclaration',
240+
},
241+
],
242+
},
243+
],
244+
},
199245
],
200246
};

0 commit comments

Comments
 (0)