@rsvelte/compiler 0.9.8 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@rsvelte/compiler",
3
3
  "type": "module",
4
4
  "description": "A high-performance Rust implementation of the Svelte compiler",
5
- "version": "0.9.8",
5
+ "version": "0.10.1",
6
6
  "license": "MIT",
7
7
  "files": [
8
8
  "rsvelte_lint_bg.wasm",
package/rsvelte_lint.d.ts CHANGED
@@ -71,6 +71,13 @@ export function lint_rules(): string;
71
71
  */
72
72
  export function lint_version(): string;
73
73
 
74
+ /**
75
+ * [`lint`] under the text of a `rsvelte-lint.json`. Wasm has no filesystem, so
76
+ * the host (the language server) discovers the config file and passes its
77
+ * contents in; `""` selects the recommended preset.
78
+ */
79
+ export function lint_with_config(source: string, filename: string, config: string): string;
80
+
74
81
  /**
75
82
  * Parse a Svelte component and return the AST as JSON.
76
83
  */
@@ -106,6 +113,7 @@ export interface InitOutput {
106
113
  readonly lint: (a: number, b: number, c: number, d: number) => [number, number];
107
114
  readonly lint_rules: () => [number, number];
108
115
  readonly lint_version: () => [number, number];
116
+ readonly lint_with_config: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
109
117
  readonly parse_svelte: (a: number, b: number) => number;
110
118
  readonly parseresultwasm_ast: (a: number) => [number, number];
111
119
  readonly parseresultwasm_error: (a: number) => [number, number];
package/rsvelte_lint.js CHANGED
@@ -260,6 +260,34 @@ export function lint_version() {
260
260
  }
261
261
  }
262
262
 
263
+ /**
264
+ * [`lint`] under the text of a `rsvelte-lint.json`. Wasm has no filesystem, so
265
+ * the host (the language server) discovers the config file and passes its
266
+ * contents in; `""` selects the recommended preset.
267
+ * @param {string} source
268
+ * @param {string} filename
269
+ * @param {string} config
270
+ * @returns {string}
271
+ */
272
+ export function lint_with_config(source, filename, config) {
273
+ let deferred4_0;
274
+ let deferred4_1;
275
+ try {
276
+ const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
277
+ const len0 = WASM_VECTOR_LEN;
278
+ const ptr1 = passStringToWasm0(filename, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
279
+ const len1 = WASM_VECTOR_LEN;
280
+ const ptr2 = passStringToWasm0(config, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
281
+ const len2 = WASM_VECTOR_LEN;
282
+ const ret = wasm.lint_with_config(ptr0, len0, ptr1, len1, ptr2, len2);
283
+ deferred4_0 = ret[0];
284
+ deferred4_1 = ret[1];
285
+ return getStringFromWasm0(ret[0], ret[1]);
286
+ } finally {
287
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
288
+ }
289
+ }
290
+
263
291
  /**
264
292
  * Parse a Svelte component and return the AST as JSON.
265
293
  * @param {string} source
Binary file