Skip to content

Releases: sveltejs/language-tools

extensions-105.1.0

03 Jun 10:52
b807aa1

Choose a tag to compare

typescript-plugin-0.2.1

28 May 07:53
1ddb7a1

Choose a tag to compare

  • (perf) only try to resolve on our own if filename ends with .svelte
  • (breaking) be more strict with required props (#1030)

Breaking Change

Previously, properties that had no initializer were only required if the user was using both TypeScript and activated strict mode. This is changed now: People using TypeScript, and those using checkJs also in JavaScript files, will always see this behavior now.

svelte2tsx-0.2.0

28 May 07:37
82451d3

Choose a tag to compare

  • (fix) correct attribute name: fill-rule instead of fillRule
  • (feat) add aria jsx type declarations (#957)
  • (breaking) be more strict with required props: remove strictMode option (#1030)

Breaking Change

The strictMode option was removed. It was only used to determine whether or not all properties should be marked as optional. This behavior was adjusted: Now all properties that are not initialized are treated as required. This applies to both TS and JS files.

svelte-check-2.0.0

28 May 07:57
82451d3

Choose a tag to compare

  • (fix) correct attribute name: fill-rule instead of fillRule
  • (fix) more robust mapping for Svelte diagnostics (#1035)
  • (feat) add aria jsx type declarations (#957)
  • (breaking) be more strict with required props (#1030)

Breaking Change

Previously, properties that had no initializer were only required if the user was using both TypeScript and activated strict mode. This is changed now: People using TypeScript, and those using checkJs also in JavaScript files, will always see this behavior now.

The fix is to provide a default value for properties that are optional. That's either the specific value kind or undefined.
Example TS:
export let optional: string;
Becomes
export let optional: string = ''; (or just export let optional = '')
Example JS:
export let optional;
Becomes
export let optional = undefined;

If you don't have control over the code because it's from a library, ask the author of that library to adjust their code. In the meantime you can create a d.ts file where you specify the types yourself.
Example:

<script>
  import { Foo } from 'package';
  import Bar from 'package/File.svelte';
</script>

Create a .d.ts file:

declare module 'package' {
  import { SvelteComponentTyped } from 'svelte';
  export class Foo extends SvelteComponentTyped<{..props definition here..}> {}
}
declare module 'package/File.svelte' {
  import { SvelteComponentTyped } from 'svelte';
  export default class Bar extends SvelteComponentTyped<{..props definition here..}> {}
}

language-server-0.14.0

28 May 07:49
82451d3

Choose a tag to compare

  • (chore) bump typescript to 4.3 and support semantic tokens on js (#1032)
  • (fix) more robust mapping for Svelte diagnostics (#1035)
  • (breaking) be more strict with required props (#1030)

Breaking Change

Previously, properties that had no initializer were only required if the user was using both TypeScript and activated strict mode. This is changed now: People using TypeScript, and those using checkJs also in JavaScript files, will always see this behavior now.

The fix is to provide a default value for properties that are optional. That's either the specific value kind or undefined.
Example TS:
export let optional: string;
Becomes
export let optional: string = ''; (or just export let optional = '')
Example JS:
export let optional;
Becomes
export let optional = undefined;

If you don't have control over the code because it's from a library, ask the author of that library to adjust their code. In the meantime you can create a d.ts file where you specify the types yourself.
Example:

<script>
  import { Foo } from 'package';
  import Bar from 'package/File.svelte';
</script>

Create a .d.ts file:

declare module 'package' {
  import { SvelteComponentTyped } from 'svelte';
  export class Foo extends SvelteComponentTyped<{..props definition here..}> {}
}
declare module 'package/File.svelte' {
  import { SvelteComponentTyped } from 'svelte';
  export default class Bar extends SvelteComponentTyped<{..props definition here..}> {}
}

extensions-105.0.0

28 May 08:10
1ddb7a1

Choose a tag to compare

  • (fix) correct attribute name: fill-rule instead of fillRule
  • (fix) more robust mapping for Svelte diagnostics (#1035)
  • (feat) add aria jsx type declarations (#957)
  • (breaking) be more strict with required props (#1030)

Breaking Change

Previously, properties that had no initializer were only required if the user was using both TypeScript and activated strict mode. This is changed now: People using TypeScript, and those using checkJs also in JavaScript files, will always see this behavior now.

The fix is to provide a default value for properties that are optional. That's either the specific value kind or undefined.
Example TS:
export let optional: string;
Becomes
export let optional: string = ''; (or just export let optional = '')
Example JS:
export let optional;
Becomes
export let optional = undefined;

If you don't have control over the code because it's from a library, ask the author of that library to adjust their code. In the meantime you can create a d.ts file where you specify the types yourself.
Example:

<script>
  import { Foo } from 'package';
  import Bar from 'package/File.svelte';
</script>

Create a .d.ts file:

declare module 'package' {
  import { SvelteComponentTyped } from 'svelte';
  export class Foo extends SvelteComponentTyped<{..props definition here..}> {}
}
declare module 'package/File.svelte' {
  import { SvelteComponentTyped } from 'svelte';
  export default class Bar extends SvelteComponentTyped<{..props definition here..}> {}
}

svelte2tsx-0.1.193

26 May 08:35
cc200f8

Choose a tag to compare

  • (fix) align type def of $set with Svelte type def

language-server-0.13.9

26 May 08:37
cc200f8

Choose a tag to compare

  • (perf) add cancellation support to some possibly long running operations (#1028)
  • (fix) remove duplicate file extension on json import (#1029)
  • (chore) pin version of svelte2tsx to 0.1.x

svelte-check-1.6.0

25 May 09:50
d0162dd

Choose a tag to compare

  • (feat) new tsconfig feature: pass in the path to your tsconfig/jsconfig and get diagnostics for all referenced files, including Svelte, JavaScript and TypeScript (#1014)
  • (feat) add --help command for CLI (#1027)
  • (perf) also cache unresolved modules (#1015)
  • (fix) add beforeinput event typing
  • (fix) better transform of custom css properties (#1024)
  • (fix) better css error diagnostics (#1009)

svelte2tsx-0.1.192

24 May 11:30
17e5664

Choose a tag to compare

  • (fix) add beforeinput event typing
  • (fix) better transform of custom css properties (#1024)