Skip to content

Commit 454d1a8

Browse files
chore(deps): update dependency prettier-plugin-pkg to ^0.19.0 (#701)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: JounQin <[email protected]>
1 parent ce53387 commit 454d1a8

File tree

5 files changed

+50
-45
lines changed

5 files changed

+50
-45
lines changed

Diff for: .prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tests/fixtures

Diff for: .prettierrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"plugins": ["prettier-plugin-pkg", "prettier-plugin-svelte"]
3+
}

Diff for: docs/AST.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ See [ESTree] for the AST node of the script generated by `espree`.
1515
[variabledeclarator]: https://github.com/estree/estree/blob/master/es5.md#variabledeclarator
1616
[pattern]: https://github.com/estree/estree/blob/master/es5.md#patterns
1717

18-
See details: [../src/ast/*](../src/ast/)
18+
See details: [../src/ast/\*](../src/ast/)
1919

2020
## Common
2121

Diff for: docs/internal-mechanism.md

+42-41
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,26 @@ For example, if you enter `*.svelte` template to listen for input events:
3838

3939
```svelte
4040
<script lang="ts">
41-
function inputHandler () {
42-
// process
43-
}
41+
function inputHandler() {
42+
// process
43+
}
4444
</script>
45-
<input on:input={inputHandler}>
45+
46+
<input on:input={inputHandler} />
4647
```
4748

4849
Parse the following virtual script code as a script:
4950

5051
```ts
51-
52-
function inputHandler () {
53-
// process
54-
}
55-
;function $_render1(){
56-
57-
(inputHandler) as ((e:'input' extends keyof HTMLElementEventMap ? HTMLElementEventMap['input'] : CustomEvent<any>) => void );
52+
function inputHandler() {
53+
// process
54+
}
55+
function $_render1() {
56+
inputHandler as (
57+
e: "input" extends keyof HTMLElementEventMap
58+
? HTMLElementEventMap["input"]
59+
: CustomEvent<any>,
60+
) => void;
5861
}
5962
```
6063

@@ -78,25 +81,24 @@ For example, when using `{#each}` and `{@const}`:
7881

7982
```svelte
8083
<script lang="ts">
81-
const array = [1, 2, 3]
84+
const array = [1, 2, 3];
8285
</script>
86+
8387
{#each array as e}
84-
{@const ee = e * 2}
85-
{ee}
88+
{@const ee = e * 2}
89+
{ee}
8690
{/each}
8791
```
8892

8993
Parse the following virtual script code as a script:
9094

9195
```ts
92-
93-
const array = [1, 2, 3]
94-
;function $_render1(){
95-
96-
Array.from(array).forEach((e) => {
96+
const array = [1, 2, 3];
97+
function $_render1() {
98+
Array.from(array).forEach((e) => {
9799
const ee = e * 2;
98-
(ee);
99-
});
100+
ee;
101+
});
100102
}
101103
```
102104

@@ -121,8 +123,9 @@ TypeScript's type inference is pretty good, so parsing Svelte as-is gives some w
121123

122124
e.g.
123125

126+
<!-- prettier-ignore -->
124127
```ts
125-
export let foo: { bar: number } | null = null
128+
export let foo: { bar: number } | null = null;
126129

127130
$: console.log(foo && foo.bar);
128131
// ^ never type
@@ -139,13 +142,13 @@ For example:
139142

140143
```svelte
141144
<script lang="ts">
142-
export let foo: { bar: number } | null = null
145+
export let foo: { bar: number } | null = null;
143146
144-
$: console.log(foo && foo.bar);
147+
$: console.log(foo && foo.bar);
145148
146-
$: r = foo && foo.bar;
149+
$: r = foo && foo.bar;
147150
148-
$: ({ bar: n } = foo || { bar: 42 });
151+
$: ({ bar: n } = foo || { bar: 42 });
149152
</script>
150153
151154
{foo && foo.bar}
@@ -154,26 +157,24 @@ $: ({ bar: n } = foo || { bar: 42 });
154157
Parse the following virtual script code as a script:
155158

156159
```ts
157-
158-
export let foo: { bar: number } | null = null
160+
export let foo: { bar: number } | null = null;
159161

160-
$: function $_reactiveStatementScopeFunction1(){
161-
console.log(foo && foo.bar);
162+
$: function $_reactiveStatementScopeFunction1() {
163+
console.log(foo && foo.bar);
162164
}
163165

164-
$: let r =$_reactiveVariableScopeFunction2();
165-
function $_reactiveVariableScopeFunction2(){
166-
let $_tmpVar3;
167-
return ($_tmpVar3 = foo && foo.bar);
166+
$: let r = $_reactiveVariableScopeFunction2();
167+
function $_reactiveVariableScopeFunction2() {
168+
let $_tmpVar3;
169+
return ($_tmpVar3 = foo && foo.bar);
168170
}
169171

170-
$: let { bar: n } =$_reactiveVariableScopeFunction4();
171-
function $_reactiveVariableScopeFunction4(){
172-
let $_tmpVar5;
173-
return ($_tmpVar5 = foo || { bar: 42 });
172+
$: let { bar: n } = $_reactiveVariableScopeFunction4();
173+
function $_reactiveVariableScopeFunction4() {
174+
let $_tmpVar5;
175+
return ($_tmpVar5 = foo || { bar: 42 });
174176
}
175-
;function $_render6(){
176-
177-
(foo && foo.bar);
177+
function $_render6() {
178+
foo && foo.bar;
178179
}
179180
```

Diff for: package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "svelte-eslint-parser",
33
"version": "1.1.2",
4+
"type": "module",
45
"description": "Svelte parser for ESLint",
56
"repository": "git+https://github.com/sveltejs/svelte-eslint-parser.git",
67
"homepage": "https://github.com/sveltejs/svelte-eslint-parser#readme",
@@ -14,7 +15,6 @@
1415
"engines": {
1516
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
1617
},
17-
"type": "module",
1818
"main": "lib/index.js",
1919
"files": [
2020
"lib"
@@ -40,10 +40,10 @@
4040
"prerelease": "pnpm run clean && pnpm run build",
4141
"preversion": "pnpm run lint && pnpm run test",
4242
"release": "changeset publish",
43+
"run-update-fixtures": "pnpm run ts ./tools/update-fixtures.ts",
4344
"test": "pnpm run mocha \"tests/src/**/*.ts\" --reporter dot --timeout 60000",
4445
"ts": "node --import tsx/esm",
4546
"update-fixtures": "git add package.json && pnpm i -D svelte@4 && git checkout package.json && pnpm run run-update-fixtures && pnpm i && pnpm run run-update-fixtures",
46-
"run-update-fixtures": "pnpm run ts ./tools/update-fixtures.ts",
4747
"version:ci": "env-cmd -e version-ci pnpm run build:meta && changeset version"
4848
},
4949
"peerDependencies": {
@@ -101,7 +101,7 @@
101101
"magic-string": "^0.30.17",
102102
"mocha": "^11.1.0",
103103
"prettier": "~3.5.3",
104-
"prettier-plugin-pkg": "^0.18.1",
104+
"prettier-plugin-pkg": "^0.19.0",
105105
"prettier-plugin-svelte": "^3.3.3",
106106
"rimraf": "^6.0.1",
107107
"semver": "^7.7.1",

0 commit comments

Comments
 (0)