Skip to content

Commit 1092aed

Browse files
committed
Merge remote-tracking branch 'origin/main' into renovate/typescript-5.x
2 parents c40767d + 97321c6 commit 1092aed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+23961
-2190
lines changed

.changeset/eighty-books-study.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"svelte-eslint-parser": minor
3+
---
4+
5+
breaking: drop @typescript-eslint v4 support

.changeset/ninety-shoes-clean.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"svelte-eslint-parser": patch
3+
---
4+
5+
feat: update `$inspect` types

.changeset/pre.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@
88
"blue-ghosts-tell",
99
"blue-pets-play",
1010
"brown-cheetahs-greet",
11+
"eighty-books-study",
1112
"friendly-hats-flow",
1213
"grumpy-dolphins-pay",
1314
"grumpy-pans-guess",
1415
"honest-mangos-wave",
1516
"nine-pandas-fly",
17+
"ninety-shoes-clean",
18+
"sharp-kangaroos-tease",
1619
"tasty-ants-ring",
1720
"twenty-cats-shave",
1821
"yellow-cooks-end"

.changeset/sharp-kangaroos-tease.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"svelte-eslint-parser": patch
3+
---
4+
5+
feat: add `$state.frozen` support

.github/workflows/NodeCI.yml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -103,26 +103,6 @@ jobs:
103103
run: pnpm install
104104
- name: Test
105105
run: pnpm run test
106-
test-for-ts-eslint-v4:
107-
runs-on: ubuntu-latest
108-
strategy:
109-
matrix:
110-
node-version: [14.x]
111-
steps:
112-
- uses: actions/checkout@v4
113-
- uses: pnpm/action-setup@v2
114-
- name: Use Node.js ${{ matrix.node-version }}
115-
uses: actions/setup-node@v4
116-
with:
117-
node-version: ${{ matrix.node-version }}
118-
- name: Install @typescript-eslint v4
119-
run: |+
120-
pnpm install -D @typescript-eslint/parser@4 @typescript-eslint/eslint-plugin@4 eslint@7 svelte@3
121-
rm -rf node_modules
122-
- name: Install Packages
123-
run: pnpm install
124-
- name: Test
125-
run: pnpm run test
126106
test-for-eslint-v7:
127107
runs-on: ubuntu-latest
128108
strategy:

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# svelte-eslint-parser
22

3+
## 0.34.0-next.7
4+
5+
### Minor Changes
6+
7+
- [#464](https://github.com/sveltejs/svelte-eslint-parser/pull/464) [`d531e4e`](https://github.com/sveltejs/svelte-eslint-parser/commit/d531e4e6552e88fe47825436ee26619039cadc7d) Thanks [@baseballyama](https://github.com/baseballyama)! - breaking: drop @typescript-eslint v4 support
8+
9+
### Patch Changes
10+
11+
- [#467](https://github.com/sveltejs/svelte-eslint-parser/pull/467) [`e27a3de`](https://github.com/sveltejs/svelte-eslint-parser/commit/e27a3de8d97dd934a8dc0097374eee3ad3ee61ff) Thanks [@baseballyama](https://github.com/baseballyama)! - feat: update `$inspect` types
12+
13+
- [#466](https://github.com/sveltejs/svelte-eslint-parser/pull/466) [`d5b3322`](https://github.com/sveltejs/svelte-eslint-parser/commit/d5b3322e19b7208815ba4251d75cf46d511cd4f1) Thanks [@baseballyama](https://github.com/baseballyama)! - feat: add `$state.frozen` support
14+
315
## 0.34.0-next.6
416

517
### Minor Changes

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "svelte-eslint-parser",
3-
"version": "0.34.0-next.6",
3+
"version": "0.34.0-next.7",
44
"description": "Svelte parser for ESLint",
55
"repository": "git+https://github.com/sveltejs/svelte-eslint-parser.git",
66
"homepage": "https://github.com/sveltejs/svelte-eslint-parser#readme",
@@ -100,12 +100,12 @@
100100
"mocha": "^10.2.0",
101101
"mocha-chai-jest-snapshot": "^1.1.4",
102102
"nyc": "^15.1.0",
103-
"prettier": "~3.1.1",
103+
"prettier": "~3.2.0",
104104
"prettier-plugin-pkg": "^0.18.0",
105105
"prettier-plugin-svelte": "^3.1.2",
106106
"rimraf": "^5.0.5",
107107
"semver": "^7.5.4",
108-
"svelte": "^5.0.0-next.25",
108+
"svelte": "^5.0.0-next.37",
109109
"svelte2tsx": "^0.7.0",
110110
"typescript": "~5.3.0",
111111
"typescript-eslint-parser-for-extra-files": "^0.6.0"

src/meta.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
// This file has been automatically generated,
33
// in order to update its content execute "pnpm run build:meta"
44
export const name = "svelte-eslint-parser" as const;
5-
export const version = "0.34.0-next.6" as const;
5+
export const version = "0.34.0-next.7" as const;

src/parser/typescript/analyze/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,10 @@ function analyzeRuneVariables(
318318
"<T>(initial: T): T",
319319
"<T>(): T | undefined",
320320
]);
321+
appendDeclareNamespaceVirtualScripts(globalName, [
322+
"export function frozen<T>(initial: T): Readonly<T>;",
323+
"export function frozen<T>(): Readonly<T> | undefined;",
324+
]);
321325
break;
322326
}
323327
case "$derived": {
@@ -343,7 +347,7 @@ function analyzeRuneVariables(
343347
}
344348
case "$inspect": {
345349
appendDeclareFunctionVirtualScripts(globalName, [
346-
`<T>(value: T, callback?: (value: T, type: 'init' | 'update') => void): void`,
350+
`<T extends any[]>(...values: T): { with: (fn: (type: 'init' | 'update', ...values: T) => void) => void }`,
347351
]);
348352
break;
349353
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<script>
2+
let numbers = $state.frozen([1, 2, 3]);
3+
</script>
4+
5+
<button onclick="{() => (numbers = [...numbers, numbers.length + 1])}">
6+
push
7+
</button>
8+
9+
<button onclick="{() => (numbers = numbers.slice(0, -1))}"> pop </button>
10+
11+
<p>
12+
{numbers.join(" + ") || 0}
13+
=
14+
{numbers.reduce((a, b) => a + b, 0)}
15+
</p>

0 commit comments

Comments
 (0)