Skip to content

Commit

Permalink
test(no-restricted-syntax): check with first matching item
Browse files Browse the repository at this point in the history
  • Loading branch information
brettz9 committed Dec 18, 2021
1 parent c91f54a commit fda6b60
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions test/rules/assertions/noRestrictedSyntax.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,36 @@ export default {
*/
function quux () {
}
`,
errors: [
{
line: 2,
message: 'The bar one: FunctionDeclaration.',
},
],
options: [{
contexts: [
{
comment: 'JsdocBlock[postDelimiter=""]:has(JsdocTypeUnion > JsdocTypeName[value="Bar"]:nth-child(1))',
context: 'FunctionDeclaration',
message: 'The bar one: {{context}}.',
},
{
comment: 'JsdocBlock[postDelimiter=""]:has(JsdocTypeUnion > JsdocTypeName[value="Foo"]:nth-child(1))',
context: 'FunctionDeclaration',
message: 'The foo one: {{context}}.',
},
],
}],
},
{
code: `
/**
* @implements {Bar|Foo}
*/
function quux () {
}
`,
errors: [
Expand Down

0 comments on commit fda6b60

Please sign in to comment.