|
| 1 | +--- |
| 2 | +source: crates/biome_js_analyze/tests/spec_tests.rs |
| 3 | +expression: issue_7876_tsdoc_linkcode.ts |
| 4 | +--- |
| 5 | +# Input |
| 6 | +```ts |
| 7 | +// See https://github.com/biomejs/biome/issues/7876 |
| 8 | +
|
| 9 | +// some types for the different locations |
| 10 | +import type LinkOnFunction from "mod"; |
| 11 | +
|
| 12 | +import type LinkOnVariable from "mod"; |
| 13 | +import type LinkOnClass from "mod"; |
| 14 | +
|
| 15 | +import type LinkOnClassField from "mod"; |
| 16 | +import type LinkOnClassMethod from "mod"; |
| 17 | +import type LinkOnClassConstructor from "mod"; |
| 18 | +import type LinkOnClassAccessor from "mod"; |
| 19 | +import type LinkOnClassIndexer from "mod"; |
| 20 | +
|
| 21 | +import type LinkOnInterface from "mod"; |
| 22 | +import type LinkOnInterfaceField from "mod"; |
| 23 | +import type LinkOnInterfaceMethod from "mod"; |
| 24 | +import type LinkOnInterfaceIndexer from "mod"; |
| 25 | +
|
| 26 | +import type LinkOnEnum from "mod"; |
| 27 | +import type LinkOnEnumMember from "mod"; |
| 28 | +
|
| 29 | +
|
| 30 | +/** |
| 31 | + * {@linkcode LinkOnFunction} |
| 32 | + */ |
| 33 | +function testLinkOnFunction() { } |
| 34 | +
|
| 35 | +/** |
| 36 | + * {@linkcode LinkOnVariable} |
| 37 | + */ |
| 38 | +const testLinkOnVariable = 3; |
| 39 | +
|
| 40 | +/** |
| 41 | + * {@linkcode LinkOnClass} |
| 42 | + */ |
| 43 | +class TestLinkOnClass { } |
| 44 | +
|
| 45 | +class TestLinkOnClassField { |
| 46 | + /** |
| 47 | + * {@linkcode LinkOnClassField} |
| 48 | + */ |
| 49 | + field: number; |
| 50 | +} |
| 51 | +
|
| 52 | +class TestLinkOnClassMethod { |
| 53 | + /** |
| 54 | + * {@linkcode LinkOnClassMethod} |
| 55 | + */ |
| 56 | + method(): void { } |
| 57 | +} |
| 58 | +
|
| 59 | +class TestLinkOnClassConstructor { |
| 60 | + /** |
| 61 | + * {@linkcode LinkOnClassConstructor} |
| 62 | + */ |
| 63 | + constructor() { } |
| 64 | +} |
| 65 | +
|
| 66 | +class TestLinkOnClassAccessor { |
| 67 | + /** |
| 68 | + * {@linkcode LinkOnClassAccessor} |
| 69 | + */ |
| 70 | + get accessor(): number { return 0 } |
| 71 | +} |
| 72 | +
|
| 73 | +class TestLinkOnClassIndexer { |
| 74 | + /** |
| 75 | + * {@linkcode LinkOnClassIndexer} |
| 76 | + */ |
| 77 | + [index: number]: string; |
| 78 | +} |
| 79 | +
|
| 80 | +/** |
| 81 | + * {@linkcode LinkOnInterface} |
| 82 | + */ |
| 83 | +interface TestLinkOnInterface { } |
| 84 | +
|
| 85 | +interface TestLinkOnInterfaceField { |
| 86 | + /** |
| 87 | + * {@linkcode LinkOnInterfaceField} |
| 88 | + */ |
| 89 | + field: string; |
| 90 | +} |
| 91 | +
|
| 92 | +interface TestLinkOnInterfaceMethod { |
| 93 | + /** |
| 94 | + * {@linkcode LinkOnInterfaceMethod} |
| 95 | + */ |
| 96 | + method(): string; |
| 97 | +} |
| 98 | +
|
| 99 | +interface TestLinkOnInterfaceIndexer { |
| 100 | + /** |
| 101 | + * {@linkcode LinkOnInterfaceIndexer} |
| 102 | + */ |
| 103 | + [index: number]: string; |
| 104 | +} |
| 105 | +
|
| 106 | +/** |
| 107 | + * {@linkcode LinkOnEnum} |
| 108 | + */ |
| 109 | +enum TestLinkOnEnum { |
| 110 | +} |
| 111 | +
|
| 112 | +enum TestLinkOnEnumMember { |
| 113 | + /** |
| 114 | + * {@linkcode LinkOnEnumMember} |
| 115 | + */ |
| 116 | + member |
| 117 | +} |
| 118 | +``` |
0 commit comments