fix: make inline doc links valid (#10365)

* fix: make inline doc links valid

* couple more

* doh

* ugh

---------

Co-authored-by: Rich Harris <rich.harris@vercel.com>
pull/10367/head
Rich Harris 11 months ago committed by GitHub
parent 283366b13a
commit 3b78c14be8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: make inline doc links valid

@ -37,3 +37,20 @@ await createBundle({
[`${pkg.name}/types/compiler/interfaces`]: `${dir}/src/compiler/types/legacy-interfaces.d.ts` [`${pkg.name}/types/compiler/interfaces`]: `${dir}/src/compiler/types/legacy-interfaces.d.ts`
} }
}); });
const types = fs.readFileSync(`${dir}/types/index.d.ts`, 'utf-8');
const bad_links = [...types.matchAll(/\]\((\/[^)]+)\)/g)];
if (bad_links.length > 0) {
// eslint-disable-next-line no-console
console.error(
`The following links in JSDoc annotations should be prefixed with https://svelte.dev:`
);
for (const [, link] of bad_links) {
// eslint-disable-next-line no-console
console.error(`- ${link}`);
}
process.exit(1);
}

@ -17,7 +17,7 @@ import { is_array } from '../internal/client/utils.js';
* *
* If a function is returned _synchronously_ from `onMount`, it will be called when the component is unmounted. * If a function is returned _synchronously_ from `onMount`, it will be called when the component is unmounted.
* *
* `onMount` does not run inside a [server-side component](/docs#run-time-server-side-component-api). * `onMount` does not run inside a [server-side component](https://svelte.dev/docs#run-time-server-side-component-api).
* *
* https://svelte.dev/docs/svelte#onmount * https://svelte.dev/docs/svelte#onmount
* @template T * @template T
@ -107,7 +107,7 @@ function create_custom_event(type, detail, { bubbles = false, cancelable = false
} }
/** /**
* Creates an event dispatcher that can be used to dispatch [component events](/docs#template-syntax-component-directives-on-eventname). * Creates an event dispatcher that can be used to dispatch [component events](https://svelte.dev/docs#template-syntax-component-directives-on-eventname).
* Event dispatchers are functions that can take two arguments: `name` and `detail`. * Event dispatchers are functions that can take two arguments: `name` and `detail`.
* *
* Component events created with `createEventDispatcher` create a * Component events created with `createEventDispatcher` create a

@ -215,7 +215,7 @@ function assign(tar, src) {
} }
/** /**
* The `crossfade` function creates a pair of [transitions](/docs#template-syntax-element-directives-transition-fn) called `send` and `receive`. When an element is 'sent', it looks for a corresponding element being 'received', and generates a transition that transforms the element to its counterpart's position and fades it out. When an element is 'received', the reverse happens. If there is no counterpart, the `fallback` transition is used. * The `crossfade` function creates a pair of [transitions](https://svelte.dev/docs#template-syntax-element-directives-transition-fn) called `send` and `receive`. When an element is 'sent', it looks for a corresponding element being 'received', and generates a transition that transforms the element to its counterpart's position and fades it out. When an element is 'received', the reverse happens. If there is no counterpart, the `fallback` transition is used.
* *
* https://svelte.dev/docs/svelte-transition#crossfade * https://svelte.dev/docs/svelte-transition#crossfade
* @param {import('./public').CrossfadeParams & { * @param {import('./public').CrossfadeParams & {

@ -229,7 +229,7 @@ declare module 'svelte' {
* *
* If a function is returned _synchronously_ from `onMount`, it will be called when the component is unmounted. * If a function is returned _synchronously_ from `onMount`, it will be called when the component is unmounted.
* *
* `onMount` does not run inside a [server-side component](/docs#run-time-server-side-component-api). * `onMount` does not run inside a [server-side component](https://svelte.dev/docs#run-time-server-side-component-api).
* *
* https://svelte.dev/docs/svelte#onmount * https://svelte.dev/docs/svelte#onmount
* */ * */
@ -267,7 +267,7 @@ declare module 'svelte' {
* */ * */
export function getAllContexts<T extends Map<any, any> = Map<any, any>>(): T; export function getAllContexts<T extends Map<any, any> = Map<any, any>>(): T;
/** /**
* Creates an event dispatcher that can be used to dispatch [component events](/docs#template-syntax-component-directives-on-eventname). * Creates an event dispatcher that can be used to dispatch [component events](https://svelte.dev/docs#template-syntax-component-directives-on-eventname).
* Event dispatchers are functions that can take two arguments: `name` and `detail`. * Event dispatchers are functions that can take two arguments: `name` and `detail`.
* *
* Component events created with `createEventDispatcher` create a * Component events created with `createEventDispatcher` create a
@ -2169,7 +2169,7 @@ declare module 'svelte/transition' {
getTotalLength(): number; getTotalLength(): number;
}, { delay, speed, duration, easing }?: DrawParams | undefined): TransitionConfig; }, { delay, speed, duration, easing }?: DrawParams | undefined): TransitionConfig;
/** /**
* The `crossfade` function creates a pair of [transitions](/docs#template-syntax-element-directives-transition-fn) called `send` and `receive`. When an element is 'sent', it looks for a corresponding element being 'received', and generates a transition that transforms the element to its counterpart's position and fades it out. When an element is 'received', the reverse happens. If there is no counterpart, the `fallback` transition is used. * The `crossfade` function creates a pair of [transitions](https://svelte.dev/docs#template-syntax-element-directives-transition-fn) called `send` and `receive`. When an element is 'sent', it looks for a corresponding element being 'received', and generates a transition that transforms the element to its counterpart's position and fades it out. When an element is 'received', the reverse happens. If there is no counterpart, the `fallback` transition is used.
* *
* https://svelte.dev/docs/svelte-transition#crossfade * https://svelte.dev/docs/svelte-transition#crossfade
* */ * */

Loading…
Cancel
Save