Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/preprocessors/typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Make sure to follow the [setup instructions](/packages/svelte-vscode#setup)
The following code may throw an error like `Variable 'show' implicitly has type 'any' in some locations where its type cannot be determined.`, if you have stricter type settings:

```html
<script lang="typescript">
<script lang="ts">
export let data: { someKey: string | null };

$: show = !!data.someKey; // <-- `show` has type `any`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script lang="typescript">
<script lang="ts">
export let noUsedBeforeDeclare: number, anotherUsed: boolean;
const blubb = 2;
$: bla = blubb * 2;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script lang="typescript">
<script lang="ts">
import {C} from 'blubb';
import {B} from 'bla';
import {A} from 'bla';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script lang="typescript">
<script lang="ts">
import {blubb} from './definitions';
import ImportedFile from './imported-file.svelte';
function bla() {return true;}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<script lang="typescript">const asd: string = true;asd;</script>
<script lang="ts">const asd: string = true;asd;</script>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script lang="typescript">
<script lang="ts">
import { foo } from './documentation'

fo
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script lang="typescript">
<script lang="ts">
let a: string | boolean = null as any;
let promise = Promise.resolve(true);
</script>
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<script lang="typescript">export let prop: string;</script>
<script lang="ts">export let prop: string;</script>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script lang="typescript">
<script lang="ts">
let a: string | boolean = null as any;
let promise = Promise.resolve(true);
</script>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script lang="typescript">
<script lang="ts">
import { foo } from '../documentation'

foo()
Expand Down
26 changes: 13 additions & 13 deletions packages/svelte2tsx/svelte-jsx.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ declare namespace svelte.JSX {
|'unselectable';

/**
* @deprecated use the types from `svelte/elements` instead, or the .
* @deprecated use the types from `svelte/elements` instead
* For more info see https://github.com/sveltejs/language-tools/blob/master/docs/preprocessors/typescript.md#im-getting-deprecation-warnings-for-sveltejsx--i-want-to-migrate-to-the-new-typings
*/
interface DOMAttributes<T extends EventTarget> {
Expand Down Expand Up @@ -670,7 +670,7 @@ declare namespace svelte.JSX {
}

/**
* @deprecated use the types from `svelte/elements` instead, or the .
* @deprecated use the types from `svelte/elements` instead
* For more info see https://github.com/sveltejs/language-tools/blob/master/docs/preprocessors/typescript.md#im-getting-deprecation-warnings-for-sveltejsx--i-want-to-migrate-to-the-new-typings
*/
interface AriaAttributes {
Expand Down Expand Up @@ -725,7 +725,7 @@ declare namespace svelte.JSX {
}

/**
* @deprecated use the types from `svelte/elements` instead, or the .
* @deprecated use the types from `svelte/elements` instead
* For more info see https://github.com/sveltejs/language-tools/blob/master/docs/preprocessors/typescript.md#im-getting-deprecation-warnings-for-sveltejsx--i-want-to-migrate-to-the-new-typings
*/
interface HTMLAttributes<T extends EventTarget> extends AriaAttributes, DOMAttributes<T> {
Expand Down Expand Up @@ -904,7 +904,7 @@ declare namespace svelte.JSX {
}

/**
* @deprecated use the types from `svelte/elements` instead, or the .
* @deprecated use the types from `svelte/elements` instead
* For more info see https://github.com/sveltejs/language-tools/blob/master/docs/preprocessors/typescript.md#im-getting-deprecation-warnings-for-sveltejsx--i-want-to-migrate-to-the-new-typings
*/
interface SVGAttributes<T extends EventTarget> extends AriaAttributes, DOMAttributes<T> {
Expand Down Expand Up @@ -1172,18 +1172,18 @@ declare namespace svelte.JSX {
}

/**
* @deprecated use the types from `svelte/elements` instead, or the .
* @deprecated use the types from `svelte/elements` instead
* For more info see https://github.com/sveltejs/language-tools/blob/master/docs/preprocessors/typescript.md#im-getting-deprecation-warnings-for-sveltejsx--i-want-to-migrate-to-the-new-typings
*/
interface HTMLProps<T extends EventTarget> extends HTMLAttributes<T> {}
/**
* @deprecated use the types from `svelte/elements` instead, or the .
* @deprecated use the types from `svelte/elements` instead
* For more info see https://github.com/sveltejs/language-tools/blob/master/docs/preprocessors/typescript.md#im-getting-deprecation-warnings-for-sveltejsx--i-want-to-migrate-to-the-new-typings
*/
interface SVGProps<T extends EventTarget> extends SVGAttributes<T> {}

/**
* @deprecated use the types from `svelte/elements` instead, or the .
* @deprecated use the types from `svelte/elements` instead
* For more info see https://github.com/sveltejs/language-tools/blob/master/docs/preprocessors/typescript.md#im-getting-deprecation-warnings-for-sveltejsx--i-want-to-migrate-to-the-new-typings
*/
interface SvelteInputProps extends HTMLProps<HTMLInputElement> {
Expand All @@ -1193,7 +1193,7 @@ declare namespace svelte.JSX {
}

/**
* @deprecated use the types from `svelte/elements` instead, or the .
* @deprecated use the types from `svelte/elements` instead
* For more info see https://github.com/sveltejs/language-tools/blob/master/docs/preprocessors/typescript.md#im-getting-deprecation-warnings-for-sveltejsx--i-want-to-migrate-to-the-new-typings
*/
interface SvelteWindowProps {
Expand Down Expand Up @@ -1238,7 +1238,7 @@ declare namespace svelte.JSX {
}

/**
* @deprecated use the types from `svelte/elements` instead, or the .
* @deprecated use the types from `svelte/elements` instead
* For more info see https://github.com/sveltejs/language-tools/blob/master/docs/preprocessors/typescript.md#im-getting-deprecation-warnings-for-sveltejsx--i-want-to-migrate-to-the-new-typings
*/
interface SapperAnchorProps {
Expand All @@ -1248,7 +1248,7 @@ declare namespace svelte.JSX {
}

/**
* @deprecated use the types from `svelte/elements` instead, or the .
* @deprecated use the types from `svelte/elements` instead
* For more info see https://github.com/sveltejs/language-tools/blob/master/docs/preprocessors/typescript.md#im-getting-deprecation-warnings-for-sveltejsx--i-want-to-migrate-to-the-new-typings
*/
interface SvelteMediaTimeRange {
Expand All @@ -1257,7 +1257,7 @@ declare namespace svelte.JSX {
}

/**
* @deprecated use the types from `svelte/elements` instead, or the .
* @deprecated use the types from `svelte/elements` instead
* For more info see https://github.com/sveltejs/language-tools/blob/master/docs/preprocessors/typescript.md#im-getting-deprecation-warnings-for-sveltejsx--i-want-to-migrate-to-the-new-typings
*/
interface SvelteMediaProps {
Expand Down Expand Up @@ -1286,7 +1286,7 @@ declare namespace svelte.JSX {
}

/**
* @deprecated use the types from `svelte/elements` instead, or the .
* @deprecated use the types from `svelte/elements` instead
* For more info see https://github.com/sveltejs/language-tools/blob/master/docs/preprocessors/typescript.md#im-getting-deprecation-warnings-for-sveltejsx--i-want-to-migrate-to-the-new-typings
*/
interface SvelteVideoProps extends SvelteMediaProps {
Expand All @@ -1296,7 +1296,7 @@ declare namespace svelte.JSX {
}

/**
* @deprecated use the types from `svelte/elements` instead, or the .
* @deprecated use the types from `svelte/elements` instead
* For more info see https://github.com/sveltejs/language-tools/blob/master/docs/preprocessors/typescript.md#im-getting-deprecation-warnings-for-sveltejsx--i-want-to-migrate-to-the-new-typings
*/
interface IntrinsicElements {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script lang="typescript">
<script lang="ts">
let a: 1 | 2 = 1;
$: {
console.log(a + 1);
Expand Down