Skip to content

Commit 29452db

Browse files
authored
feat: update svelte2tsx to >=0.7.9 (#114)
* feat: update svelte2tsx to >=0.7.9 * Create loud-bags-film.md
1 parent a517a42 commit 29452db

File tree

5 files changed

+14
-6
lines changed

5 files changed

+14
-6
lines changed

Diff for: .changeset/loud-bags-film.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"typescript-eslint-parser-for-extra-files": minor
3+
---
4+
5+
feat: update svelte2tsx to >=0.7.9

Diff for: .npmrc

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
package-lock=false
1+
package-lock=false
2+
force=true

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"peerDependencies": {
5151
"@typescript-eslint/parser": ">=5.41.0",
5252
"astrojs-compiler-sync": ">=0.3.1",
53-
"svelte2tsx": ">=0.5.20",
53+
"svelte2tsx": ">=0.7.9",
5454
"typescript": ">=4.8.4",
5555
"vue": "^3.2.45"
5656
},

Diff for: src/transform/svelte.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ export function transformForSvelte(
77
if (context.current) {
88
return code;
99
}
10+
1011
// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires -- ignore
1112
const svelte2tsx: typeof Svelte2tsx = require("svelte2tsx");
1213
const result = svelte2tsx.svelte2tsx(code, {
1314
filename: context.filePath,
1415
});
1516

16-
return `/// <reference types="svelte2tsx/svelte-shims" />
17-
17+
return `/// <reference types="svelte2tsx/svelte-shims-v4" />
18+
/// <reference types="svelte2tsx/svelte-shims" />
19+
1820
${result.code}`;
1921
}

Diff for: tests/src/utils/utils.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type * as tsEslintParser from "@typescript-eslint/parser";
22
import path from "path";
33
import * as vueParser from "vue-eslint-parser";
44

5-
const PROJECT_ROOT = path.join(__dirname, "../../..");
5+
const PROJECT_ROOT = path.normalize(path.join(__dirname, "../../.."));
66

77
export function buildTypes(
88
input: string,
@@ -59,7 +59,7 @@ export function buildTypes(
5959
return `${l} // ${types[i].join(", ").replace(/\n\s*/g, " ")}`;
6060
})
6161
.join("\n")
62-
.replace(new RegExp(escapeRegExp(PROJECT_ROOT), "gu"), "");
62+
.replace(new RegExp(escapeRegExp(PROJECT_ROOT), "giu"), "");
6363
}
6464

6565
function escapeRegExp(string: string) {

0 commit comments

Comments
 (0)