Skip to content

Commit 83a0479

Browse files
committed
Merge remote-tracking branch 'origin/main' into renovate/typescript-5.x
2 parents 0867262 + af27034 commit 83a0479

File tree

341 files changed

+210878
-535
lines changed

Some content is hidden

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

341 files changed

+210878
-535
lines changed

.changeset/blue-ghosts-tell.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+
feat: apply correct type information to `$derived` argument expression

.changeset/blue-pets-play.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+
feat: Support runes

.changeset/brown-cheetahs-greet.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+
feat: apply runes to `*.svelte.js` and `*.svelte.ts`.

.changeset/friendly-hats-flow.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+
feat: (experimental) partial support for Svelte v5 parser

.changeset/grumpy-dolphins-pay.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+
feat: skip type injection if template uses TypeScript

.changeset/grumpy-pans-guess.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+
feat: add support for `{#snippet}` and `{@render}`

.changeset/honest-mangos-wave.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+
fix: incorrect location when there is whitespace at the beginning of block

.changeset/nine-pandas-fly.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+
feat: add type of `$effect.active`

.changeset/pre.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"mode": "pre",
3+
"tag": "next",
4+
"initialVersions": {
5+
"svelte-eslint-parser": "0.33.1"
6+
},
7+
"changesets": [
8+
"blue-ghosts-tell",
9+
"blue-pets-play",
10+
"brown-cheetahs-greet",
11+
"friendly-hats-flow",
12+
"grumpy-dolphins-pay",
13+
"grumpy-pans-guess",
14+
"honest-mangos-wave",
15+
"nine-pandas-fly",
16+
"tasty-ants-ring",
17+
"twenty-cats-shave",
18+
"yellow-cooks-end"
19+
]
20+
}

.changeset/tasty-ants-ring.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+
fix: incorrect location for `{ #await expr then v }` with spaces

.changeset/twenty-cats-shave.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+
feat: add support for `$inspect` and `$effect.root`

.changeset/yellow-cooks-end.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+
feat: improve props type

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
/node_modules
55
/tests/fixtures/**/*.json
66
/tests/fixtures/**/*.svelte
7+
/tests/fixtures/**/*.js
8+
/tests/fixtures/**/*.ts
79
/explorer/dist
810
/explorer/node_modules
911
/explorer-v2/build

.eslintrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ module.exports = {
2020
"no-lonely-if": "off",
2121
"no-shadow": "off",
2222
"no-warning-comments": "warn",
23-
"require-jsdoc": "error",
23+
"require-jsdoc": "off",
24+
complexity: "off",
2425
"prettier/prettier": [
2526
"error",
2627
{},

.github/workflows/GHPages.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ jobs:
3636
pnpm run pre-build
3737
pnpm run build
3838
- name: Setup Pages
39-
uses: actions/configure-pages@v3
39+
uses: actions/configure-pages@v4
4040
- name: Upload artifact
41-
uses: actions/upload-pages-artifact@v2
41+
uses: actions/upload-pages-artifact@v3
4242
with:
4343
path: ./explorer-v2/build
4444
- name: Deploy to GitHub Pages
4545
id: deployment
46-
uses: actions/deploy-pages@v2
46+
uses: actions/deploy-pages@v4

.github/workflows/NodeCI.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,34 @@ jobs:
3535
run: pnpm install
3636
- name: Test
3737
run: pnpm run test
38+
test-for-svelte-v5:
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/checkout@v4
42+
- uses: pnpm/action-setup@v2
43+
- name: Use Node.js
44+
uses: actions/setup-node@v4
45+
- name: Install Packages
46+
run: pnpm install
47+
- name: Test
48+
run: pnpm run test
49+
50+
test-for-svelte-v4:
51+
runs-on: ubuntu-latest
52+
steps:
53+
- uses: actions/checkout@v4
54+
- uses: pnpm/action-setup@v2
55+
- name: Use Node.js
56+
uses: actions/setup-node@v4
57+
- name: Install Svelte v4
58+
run: |+
59+
pnpm install -D svelte@4
60+
rm -rf node_modules
61+
- name: Install Packages
62+
run: pnpm install
63+
- name: Test
64+
run: pnpm run test
65+
3866
test-for-svelte-v3:
3967
runs-on: ubuntu-latest
4068
strategy:

.github/workflows/stale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
name: Close stale issues with missing information
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/stale@v8
16+
- uses: actions/stale@v9
1717
with:
1818
any-of-labels: "needs repro,needs info,needs more info"
1919
days-before-stale: 60

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"javascript.validate.enable": false,
1414
"typescript.tsdk": "node_modules/typescript/lib",
1515
"editor.codeActionsOnSave": {
16-
"source.fixAll.eslint": true
16+
"source.fixAll.eslint": "explicit"
1717
},
1818
"vetur.validation.template": false
1919
}

CHANGELOG.md

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

3+
## 0.34.0-next.6
4+
5+
### Minor Changes
6+
7+
- [#446](https://github.com/sveltejs/svelte-eslint-parser/pull/446) [`168f920`](https://github.com/sveltejs/svelte-eslint-parser/commit/168f9209e8ea9f2a1ef2fad28728f6aa0963638f) Thanks [@ota-meshi](https://github.com/ota-meshi)! - feat: add support for `$inspect` and `$effect.root`
8+
9+
## 0.34.0-next.5
10+
11+
### Minor Changes
12+
13+
- [#440](https://github.com/sveltejs/svelte-eslint-parser/pull/440) [`726f21f`](https://github.com/sveltejs/svelte-eslint-parser/commit/726f21fc7a520abe8b7b0be268f2ceb9b3205531) Thanks [@baseballyama](https://github.com/baseballyama)! - feat: skip type injection if template uses TypeScript
14+
15+
- [#441](https://github.com/sveltejs/svelte-eslint-parser/pull/441) [`34232c5`](https://github.com/sveltejs/svelte-eslint-parser/commit/34232c58b49abdb362d74d849e80ef5607d0ce52) Thanks [@baseballyama](https://github.com/baseballyama)! - feat: add type of `$effect.active`
16+
17+
## 0.34.0-next.4
18+
19+
### Patch Changes
20+
21+
- [#438](https://github.com/sveltejs/svelte-eslint-parser/pull/438) [`c21b54c`](https://github.com/sveltejs/svelte-eslint-parser/commit/c21b54ced7984aaeaac6b12ff66bfc4cc0712caf) Thanks [@ota-meshi](https://github.com/ota-meshi)! - fix: incorrect location for `{ #await expr then v }` with spaces
22+
23+
## 0.34.0-next.3
24+
25+
### Minor Changes
26+
27+
- [#435](https://github.com/sveltejs/svelte-eslint-parser/pull/435) [`7508680`](https://github.com/sveltejs/svelte-eslint-parser/commit/7508680b3a88c951fa3fe0bdd9b59b21d6034b27) Thanks [@ota-meshi](https://github.com/ota-meshi)! - feat: improve props type
28+
29+
### Patch Changes
30+
31+
- [#434](https://github.com/sveltejs/svelte-eslint-parser/pull/434) [`0ef067b`](https://github.com/sveltejs/svelte-eslint-parser/commit/0ef067b57ab8897cff03f8793c2767e6d0b83274) Thanks [@ota-meshi](https://github.com/ota-meshi)! - fix: incorrect location when there is whitespace at the beginning of block
32+
33+
## 0.34.0-next.2
34+
35+
### Minor Changes
36+
37+
- [#430](https://github.com/sveltejs/svelte-eslint-parser/pull/430) [`af1bae5`](https://github.com/sveltejs/svelte-eslint-parser/commit/af1bae5d4eb9c9605e4f2ad66590b14f1bfa9a55) Thanks [@ota-meshi](https://github.com/ota-meshi)! - feat: apply correct type information to `$derived` argument expression
38+
39+
- [#431](https://github.com/sveltejs/svelte-eslint-parser/pull/431) [`ab13a46`](https://github.com/sveltejs/svelte-eslint-parser/commit/ab13a4662410014ad7d53fc7664bd5b464f15cbe) Thanks [@ota-meshi](https://github.com/ota-meshi)! - feat: add support for `{#snippet}` and `{@render}`
40+
41+
## 0.34.0-next.1
42+
43+
### Minor Changes
44+
45+
- [#425](https://github.com/sveltejs/svelte-eslint-parser/pull/425) [`ff242c4`](https://github.com/sveltejs/svelte-eslint-parser/commit/ff242c4abc322fd6bc93fda9fb30da14d73a847e) Thanks [@baseballyama](https://github.com/baseballyama)! - feat: Support runes
46+
47+
- [#426](https://github.com/sveltejs/svelte-eslint-parser/pull/426) [`9793cb0`](https://github.com/sveltejs/svelte-eslint-parser/commit/9793cb0d4520b1d5ae9e1f0aa5aff1c8b84cebb6) Thanks [@ota-meshi](https://github.com/ota-meshi)! - feat: apply runes to `*.svelte.js` and `*.svelte.ts`.
48+
49+
## 0.34.0-next.0
50+
51+
### Minor Changes
52+
53+
- [#421](https://github.com/sveltejs/svelte-eslint-parser/pull/421) [`59fc0e9`](https://github.com/sveltejs/svelte-eslint-parser/commit/59fc0e90bdd20f208a4ae8c3527ea51acf106811) Thanks [@ota-meshi](https://github.com/ota-meshi)! - feat: (experimental) partial support for Svelte v5 parser
54+
355
## 0.33.1
456

557
### Patch Changes

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,44 @@ module.exports = {
169169
}
170170
```
171171

172+
### Runes support
173+
174+
***This is an experimental feature. It may be changed or removed in minor versions without notice.***
175+
176+
If you install Svelte v5 the parser will be able to parse runes, and will also be able to parse `*.js` and `*.ts` files.
177+
178+
When using this mode in an ESLint configuration, it is recommended to set it per file pattern as below.
179+
180+
```json
181+
{
182+
"overrides": [
183+
{
184+
"files": ["*.svelte"],
185+
"parser": "svelte-eslint-parser",
186+
"parserOptions": {
187+
"parser": "...",
188+
...
189+
}
190+
},
191+
{
192+
"files": ["*.svelte.js"],
193+
"parser": "svelte-eslint-parser",
194+
"parserOptions": {
195+
...
196+
}
197+
},
198+
{
199+
"files": ["*.svelte.ts"],
200+
"parser": "svelte-eslint-parser",
201+
"parserOptions": {
202+
"parser": "...(ts parser)...",
203+
...
204+
}
205+
}
206+
]
207+
}
208+
```
209+
172210
## :computer: Editor Integrations
173211

174212
### Visual Studio Code

benchmark/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// eslint-disable-next-line eslint-comments/disable-enable-pair -- ignore
2-
/* eslint-disable require-jsdoc, no-console -- ignore */
2+
/* eslint-disable no-console -- ignore */
33
import * as Benchmark from "benchmark";
44
import fs from "fs";
55
import { parseForESLint } from "../src/index";

docs/AST.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,12 @@ type Child =
104104
| SvelteMustacheTag
105105
| SvelteDebugTag
106106
| SvelteConstTag
107+
| SvelteRenderTag
107108
| SvelteIfBlock
108109
| SvelteEachBlock
109110
| SvelteAwaitBlock
110111
| SvelteKeyBlock
112+
| SvelteSnippetBlock
111113
| SvelteHTMLComment;
112114
```
113115

@@ -421,6 +423,18 @@ interface SvelteConstTag extends Node {
421423
}
422424
```
423425

426+
### SvelteRenderTag
427+
428+
This is the `{@render}` tag node.
429+
430+
```ts
431+
interface SvelteRenderTag extends Node {
432+
type: "SvelteRenderTag";
433+
callee: Identifier;
434+
argument: Expression | null;
435+
}
436+
```
437+
424438
[VariableDeclarator] is a node defined in ESTree.
425439

426440
### SvelteIfBlock
@@ -533,6 +547,19 @@ interface SvelteKeyBlock extends Node {
533547
}
534548
```
535549

550+
### SvelteSnippetBlock
551+
552+
This is the `{#snippet}` tag node.
553+
554+
```ts
555+
interface SvelteSnippetBlock extends Node {
556+
type: "SvelteSnippetBlock";
557+
id: Identifier;
558+
context: null | Pattern;
559+
children: Child[];
560+
}
561+
```
562+
536563
## Comments
537564

538565
### SvelteHTMLComment

explorer-v2/package.json

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,27 @@
1212
"preview": "vite preview"
1313
},
1414
"dependencies": {
15-
"@fontsource/fira-mono": "^5.0.0",
16-
"@typescript-eslint/parser": "^6.0.0",
17-
"eslint": "^8.0.0",
18-
"eslint-scope": "^7.0.0",
15+
"@fontsource/fira-mono": "^5.0.8",
16+
"@typescript-eslint/parser": "^6.14.0",
17+
"eslint": "^8.55.0",
18+
"eslint-scope": "^7.2.2",
1919
"esquery": "^1.5.0",
20-
"pako": "^2.0.3",
21-
"svelte": "^4.0.0",
20+
"pako": "^2.1.0",
21+
"svelte": "^5.0.0-next.25",
2222
"svelte-eslint-parser": "link:..",
23-
"tslib": "^2.5.0"
23+
"tslib": "^2.6.2"
2424
},
2525
"devDependencies": {
26-
"@sveltejs/adapter-static": "^2.0.0",
27-
"@sveltejs/kit": "^1.0.0-next.456",
28-
"prettier": "^3.0.0",
29-
"prettier-plugin-svelte": "^3.0.0",
30-
"string-replace-loader": "^3.0.1",
31-
"typescript": "^5.0.4",
32-
"vite": "^4.0.0",
33-
"webpack": "^5.82.1",
34-
"webpack-cli": "^5.0.0",
35-
"wrapper-webpack-plugin": "^2.1.0"
26+
"@sveltejs/adapter-static": "^3.0.0",
27+
"@sveltejs/kit": "^2.0.0",
28+
"@sveltejs/vite-plugin-svelte": "^3.0.1",
29+
"prettier": "^3.1.1",
30+
"prettier-plugin-svelte": "^3.1.2",
31+
"string-replace-loader": "^3.1.0",
32+
"typescript": "^5.3.3",
33+
"vite": "^5.0.9",
34+
"webpack": "^5.89.0",
35+
"webpack-cli": "^5.1.4",
36+
"wrapper-webpack-plugin": "^2.2.2"
3637
}
3738
}

explorer-v2/src/app.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />
55
<link rel="icon" href="/svelte-eslint-parser/favicon.ico" />
66
<meta name="viewport" content="width=device-width, initial-scale=1" />
77

88
%sveltekit.head%
9-
<script src="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.44.0/min/vs/loader.min.js"></script>
9+
<script src="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.45.0/min/vs/loader.min.js"></script>
1010
</head>
1111
<body>
1212
<div id="svelte">%sveltekit.body%</div>

0 commit comments

Comments
 (0)