Skip to content

Commit

Permalink
docs(require-jsdoc): add example to exclude Property context
Browse files Browse the repository at this point in the history
  • Loading branch information
brettz9 committed Nov 23, 2020
1 parent ecf4978 commit 68eb1c3
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Expand Up @@ -10952,6 +10952,13 @@ export function foo(): void {
console.log('foo');
}
// Options: [{"publicOnly":true}]

const foo = {
bar: () => {
// ...
}
}
// Options: [{"contexts":[":not(Property) > ArrowFunctionExpression"],"require":{"ArrowFunctionExpression":false,"ClassDeclaration":true,"ClassExpression":true}}]
````


Expand Down
19 changes: 19 additions & 0 deletions test/rules/assertions/requireJsdoc.js
Expand Up @@ -4183,5 +4183,24 @@ export default {
}],
parser: require.resolve('@typescript-eslint/parser'),
},
{
code: `
const foo = {
bar: () => {
// ...
}
}
`,
options: [{
contexts: [
':not(Property) > ArrowFunctionExpression',
],
require: {
ArrowFunctionExpression: false,
ClassDeclaration: true,
ClassExpression: true,
},
}],
},
],
};

0 comments on commit 68eb1c3

Please sign in to comment.