Skip to content

Commit d730290

Browse files
committed
test: example for inline link targeting
1 parent 30f62ed commit d730290

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

docs/rules/require-param.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1812,5 +1812,9 @@ function foo(this: T, bar: number): number {
18121812
console.log(this.name);
18131813
return bar;
18141814
}
1815+
1816+
/** {@link someOtherval} */
1817+
function a (b) {}
1818+
// "jsdoc/require-param": ["error"|"warn", {"contexts":[{"comment":"*:not(JsdocBlock:has(JsdocInlineTag[tag=link]))","context":"FunctionDeclaration"}]}]
18151819
````
18161820

test/rules/assertions/requireParam.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3525,5 +3525,21 @@ export default {
35253525
`,
35263526
parser: require.resolve('@typescript-eslint/parser'),
35273527
},
3528+
{
3529+
code: `
3530+
/** {@link someOtherval} */
3531+
function a (b) {}
3532+
`,
3533+
options: [
3534+
{
3535+
contexts: [
3536+
{
3537+
comment: '*:not(JsdocBlock:has(JsdocInlineTag[tag=link]))',
3538+
context: 'FunctionDeclaration',
3539+
},
3540+
],
3541+
},
3542+
],
3543+
},
35283544
],
35293545
};

0 commit comments

Comments
 (0)