Skip to content

Commit f45c22a

Browse files
committed
Add exports option test
1 parent 28c0fdf commit f45c22a

File tree

3 files changed

+47
-2
lines changed

3 files changed

+47
-2
lines changed

.README/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ Finally, enable all of the rules that you would like to use.
122122

123123
- `settings.jsdoc.publicFunctionsOnly` - Missing jsdoc blocks
124124
are only reported for function bodies that are exported from the module.
125+
May be a boolean or object.
125126

126127
This setting object supports the following keys:
127128

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ Finally, enable all of the rules that you would like to use.
173173

174174
- `settings.jsdoc.publicFunctionsOnly` - Missing jsdoc blocks
175175
are only reported for function bodies that are exported from the module.
176+
May be a boolean or object.
176177

177178
This setting object supports the following keys:
178179

@@ -3889,11 +3890,24 @@ test = function() {
38893890
}
38903891

38913892
module.exports = {
3892-
prop: { prop2: test }
3893+
prop: { prop2: test }
38933894
}
38943895
// Settings: {"jsdoc":{"publicFunctionsOnly":{"browserEnv":false,"modules":true}}}
38953896
// Options: [{"require":{"FunctionExpression":true}}]
38963897

3898+
/**
3899+
*
3900+
*/
3901+
test = function() {
3902+
3903+
}
3904+
3905+
exports.someMethod = {
3906+
prop: { prop2: test }
3907+
}
3908+
// Settings: {"jsdoc":{"publicFunctionsOnly":{"browserEnv":false,"exports":true}}}
3909+
// Options: [{"require":{"FunctionExpression":true}}]
3910+
38973911
/**
38983912
*
38993913
*/

test/rules/assertions/requireJsdoc.js

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,7 @@ export default {
988988
}
989989
990990
module.exports = {
991-
prop: { prop2: test }
991+
prop: { prop2: test }
992992
}
993993
`,
994994
env: {
@@ -1008,6 +1008,36 @@ export default {
10081008
}
10091009
}
10101010
},
1011+
{
1012+
code: `
1013+
/**
1014+
*
1015+
*/
1016+
test = function() {
1017+
1018+
}
1019+
1020+
exports.someMethod = {
1021+
prop: { prop2: test }
1022+
}
1023+
`,
1024+
env: {
1025+
node: true
1026+
},
1027+
options: [{
1028+
require: {
1029+
FunctionExpression: true
1030+
}
1031+
}],
1032+
settings: {
1033+
jsdoc: {
1034+
publicFunctionsOnly: {
1035+
browserEnv: false,
1036+
exports: true
1037+
}
1038+
}
1039+
}
1040+
},
10111041
{
10121042
code: `
10131043
/**

0 commit comments

Comments
 (0)