Skip to content

Commit d6327c4

Browse files
authored
(chore) bump ts to 4.6 (#1402)
Most of the changes come from the fact that TS 4.6 changed some messages so they are more concise/easier to understand
1 parent bde0f88 commit d6327c4

File tree

19 files changed

+65
-58
lines changed

19 files changed

+65
-58
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"lint": "prettier --check . && eslint \"packages/**/*.{ts,js}\""
1717
},
1818
"dependencies": {
19-
"typescript": "^4.5.3"
19+
"typescript": "^4.6.2"
2020
},
2121
"devDependencies": {
2222
"@sveltejs/eslint-config": "github:sveltejs/eslint-config#v5.2.0",

packages/language-server/test/plugins/typescript/features/CodeActionsProvider.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ function test(useNewTransformation: boolean) {
239239
]
240240
},
241241
kind: 'quickfix',
242-
title: 'Import \'blubb\' from module "../definitions"'
242+
title: 'Add import from "../definitions"'
243243
},
244244
{
245245
edit: {
@@ -332,7 +332,7 @@ function test(useNewTransformation: boolean) {
332332
]
333333
},
334334
kind: 'quickfix',
335-
title: 'Import default \'Empty\' from module "../empty.svelte"'
335+
title: 'Add import from "../empty.svelte"'
336336
}
337337
]);
338338
});

packages/language-server/test/plugins/typescript/features/RenameProvider.test.ts

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -227,18 +227,25 @@ function test(useNewTransformation: boolean) {
227227
assert.deepStrictEqual(result, expectedEditsForPropRename);
228228
});
229229

230-
it('should not allow rename of intrinsic attribute', async () => {
231-
const { provider, renameDoc2 } = await setup();
232-
const prepareResult = await provider.prepareRename(renameDoc2, Position.create(7, 7));
233-
const renameResult = await provider.rename(
234-
renameDoc2,
235-
Position.create(7, 7),
236-
'newName'
237-
);
238-
239-
assert.deepStrictEqual(prepareResult, null);
240-
assert.deepStrictEqual(renameResult, null);
241-
});
230+
// Since TS 4.6 JSX attributes can be renamed, and since we remove the old transformation soon,
231+
// we don't bother
232+
if (useNewTransformation) {
233+
it('should not allow rename of intrinsic attribute', async () => {
234+
const { provider, renameDoc2 } = await setup();
235+
const prepareResult = await provider.prepareRename(
236+
renameDoc2,
237+
Position.create(7, 7)
238+
);
239+
const renameResult = await provider.rename(
240+
renameDoc2,
241+
Position.create(7, 7),
242+
'newName'
243+
);
244+
245+
assert.deepStrictEqual(prepareResult, null);
246+
assert.deepStrictEqual(renameResult, null);
247+
});
248+
}
242249

243250
it('should do rename of prop without type of component A in component A', async () => {
244251
const { provider, renameDoc3 } = await setup();

packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/$$events/expected.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
},
77
"severity": 1,
88
"source": "ts",
9-
"message": "Argument of type 'true' is not assignable to parameter of type 'string | undefined'.",
9+
"message": "Argument of type 'boolean' is not assignable to parameter of type 'string'.",
1010
"code": 2345,
1111
"tags": []
1212
},

packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/$$events/expectedv2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
},
77
"severity": 1,
88
"source": "ts",
9-
"message": "Argument of type 'true' is not assignable to parameter of type 'string | undefined'.",
9+
"message": "Argument of type 'boolean' is not assignable to parameter of type 'string'.",
1010
"code": 2345,
1111
"tags": []
1212
},

packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/$$props-invalid2/expected.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"range": { "start": { "line": 1, "character": 11 }, "end": { "line": 1, "character": 18 } },
44
"severity": 1,
55
"source": "ts",
6-
"message": "Argument of type '$$Props' is not assignable to parameter of type '{ exported1?: string | undefined; }'.\n Types of property 'exported1' are incompatible.\n Type 'boolean' is not assignable to type 'string | undefined'.",
6+
"message": "Argument of type '$$Props' is not assignable to parameter of type '{ exported1?: string | undefined; }'.\n Types of property 'exported1' are incompatible.\n Type 'boolean' is not assignable to type 'string'.",
77
"code": 2345,
88
"tags": []
99
}

packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/$$props-invalid2/expectedv2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"range": { "start": { "line": 1, "character": 11 }, "end": { "line": 1, "character": 18 } },
44
"severity": 1,
55
"source": "ts",
6-
"message": "Argument of type '$$Props' is not assignable to parameter of type '{ exported1?: string | undefined; }'.\n Types of property 'exported1' are incompatible.\n Type 'boolean' is not assignable to type 'string | undefined'.",
6+
"message": "Argument of type '$$Props' is not assignable to parameter of type '{ exported1?: string | undefined; }'.\n Types of property 'exported1' are incompatible.\n Type 'boolean' is not assignable to type 'string'.",
77
"code": 2345,
88
"tags": []
99
}

packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/$store-wrong-usage/expected.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,31 @@
33
"range": { "start": { "line": 6, "character": 1 }, "end": { "line": 6, "character": 6 } },
44
"severity": 1,
55
"source": "ts",
6-
"message": "No overload matches this call.\n Overload 1 of 2, '(store: SvelteStore<any>): any', gave the following error.\n Argument of type 'string' is not assignable to parameter of type 'SvelteStore<any>'.\n Overload 2 of 2, '(store: SvelteStore<any> | null | undefined): any', gave the following error.\n Argument of type 'string' is not assignable to parameter of type 'SvelteStore<any> | null | undefined'.",
6+
"message": "No overload matches this call.\n Overload 1 of 2, '(store: SvelteStore<any>): any', gave the following error.\n Argument of type 'string' is not assignable to parameter of type 'SvelteStore<any>'.\n Overload 2 of 2, '(store: SvelteStore<any> | null | undefined): any', gave the following error.\n Argument of type 'string' is not assignable to parameter of type 'SvelteStore<any>'.",
77
"code": 2769,
88
"tags": []
99
},
1010
{
1111
"range": { "start": { "line": 7, "character": 4 }, "end": { "line": 7, "character": 9 } },
1212
"severity": 1,
1313
"source": "ts",
14-
"message": "No overload matches this call.\n Overload 1 of 2, '(store: SvelteStore<any>): any', gave the following error.\n Argument of type 'string' is not assignable to parameter of type 'SvelteStore<any>'.\n Overload 2 of 2, '(store: SvelteStore<any> | null | undefined): any', gave the following error.\n Argument of type 'string' is not assignable to parameter of type 'SvelteStore<any> | null | undefined'.",
14+
"message": "No overload matches this call.\n Overload 1 of 2, '(store: SvelteStore<any>): any', gave the following error.\n Argument of type 'string' is not assignable to parameter of type 'SvelteStore<any>'.\n Overload 2 of 2, '(store: SvelteStore<any> | null | undefined): any', gave the following error.\n Argument of type 'string' is not assignable to parameter of type 'SvelteStore<any>'.",
1515
"code": 2769,
1616
"tags": []
1717
},
1818
{
1919
"range": { "start": { "line": 8, "character": 1 }, "end": { "line": 8, "character": 14 } },
2020
"severity": 1,
2121
"source": "ts",
22-
"message": "No overload matches this call.\n Overload 1 of 2, '(store: SvelteStore<any>): any', gave the following error.\n Argument of type 'string' is not assignable to parameter of type 'SvelteStore<any>'.\n Overload 2 of 2, '(store: SvelteStore<any> | null | undefined): any', gave the following error.\n Argument of type '\"not a store\"' is not assignable to parameter of type 'SvelteStore<any> | null | undefined'.",
22+
"message": "No overload matches this call.\n Overload 1 of 2, '(store: SvelteStore<any>): any', gave the following error.\n Argument of type 'string' is not assignable to parameter of type 'SvelteStore<any>'.\n Overload 2 of 2, '(store: SvelteStore<any> | null | undefined): any', gave the following error.\n Argument of type 'string' is not assignable to parameter of type 'SvelteStore<any>'.",
2323
"code": 2769,
2424
"tags": []
2525
},
2626
{
2727
"range": { "start": { "line": 11, "character": 2 }, "end": { "line": 11, "character": 7 } },
2828
"severity": 1,
2929
"source": "ts",
30-
"message": "No overload matches this call.\n Overload 1 of 2, '(store: SvelteStore<any>): any', gave the following error.\n Argument of type 'string' is not assignable to parameter of type 'SvelteStore<any>'.\n Overload 2 of 2, '(store: SvelteStore<any> | null | undefined): any', gave the following error.\n Argument of type 'string' is not assignable to parameter of type 'SvelteStore<any> | null | undefined'.",
30+
"message": "No overload matches this call.\n Overload 1 of 2, '(store: SvelteStore<any>): any', gave the following error.\n Argument of type 'string' is not assignable to parameter of type 'SvelteStore<any>'.\n Overload 2 of 2, '(store: SvelteStore<any> | null | undefined): any', gave the following error.\n Argument of type 'string' is not assignable to parameter of type 'SvelteStore<any>'.",
3131
"code": 2769,
3232
"tags": []
3333
},
@@ -38,7 +38,7 @@
3838
},
3939
"severity": 1,
4040
"source": "ts",
41-
"message": "No overload matches this call.\n Overload 1 of 2, '(store: SvelteStore<any>): any', gave the following error.\n Argument of type 'string' is not assignable to parameter of type 'SvelteStore<any>'.\n Overload 2 of 2, '(store: SvelteStore<any> | null | undefined): any', gave the following error.\n Argument of type 'string' is not assignable to parameter of type 'SvelteStore<any> | null | undefined'.",
41+
"message": "No overload matches this call.\n Overload 1 of 2, '(store: SvelteStore<any>): any', gave the following error.\n Argument of type 'string' is not assignable to parameter of type 'SvelteStore<any>'.\n Overload 2 of 2, '(store: SvelteStore<any> | null | undefined): any', gave the following error.\n Argument of type 'string' is not assignable to parameter of type 'SvelteStore<any>'.",
4242
"code": 2769,
4343
"tags": []
4444
},
@@ -49,7 +49,7 @@
4949
},
5050
"severity": 1,
5151
"source": "ts",
52-
"message": "No overload matches this call.\n Overload 1 of 2, '(store: SvelteStore<any>): any', gave the following error.\n Argument of type 'string' is not assignable to parameter of type 'SvelteStore<any>'.\n Overload 2 of 2, '(store: SvelteStore<any> | null | undefined): any', gave the following error.\n Argument of type '\"not a store\"' is not assignable to parameter of type 'SvelteStore<any> | null | undefined'.",
52+
"message": "No overload matches this call.\n Overload 1 of 2, '(store: SvelteStore<any>): any', gave the following error.\n Argument of type 'string' is not assignable to parameter of type 'SvelteStore<any>'.\n Overload 2 of 2, '(store: SvelteStore<any> | null | undefined): any', gave the following error.\n Argument of type 'string' is not assignable to parameter of type 'SvelteStore<any>'.",
5353
"code": 2769,
5454
"tags": []
5555
}

packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/$store-wrong-usage/expectedv2.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,31 @@
33
"range": { "start": { "line": 6, "character": 1 }, "end": { "line": 6, "character": 6 } },
44
"severity": 1,
55
"source": "ts",
6-
"message": "No overload matches this call.\n Overload 1 of 2, '(store: SvelteStore<any>): any', gave the following error.\n Argument of type 'string' is not assignable to parameter of type 'SvelteStore<any>'.\n Overload 2 of 2, '(store: SvelteStore<any> | null | undefined): any', gave the following error.\n Argument of type 'string' is not assignable to parameter of type 'SvelteStore<any> | null | undefined'.",
6+
"message": "No overload matches this call.\n Overload 1 of 2, '(store: SvelteStore<any>): any', gave the following error.\n Argument of type 'string' is not assignable to parameter of type 'SvelteStore<any>'.\n Overload 2 of 2, '(store: SvelteStore<any> | null | undefined): any', gave the following error.\n Argument of type 'string' is not assignable to parameter of type 'SvelteStore<any>'.",
77
"code": 2769,
88
"tags": []
99
},
1010
{
1111
"range": { "start": { "line": 7, "character": 4 }, "end": { "line": 7, "character": 9 } },
1212
"severity": 1,
1313
"source": "ts",
14-
"message": "No overload matches this call.\n Overload 1 of 2, '(store: SvelteStore<any>): any', gave the following error.\n Argument of type 'string' is not assignable to parameter of type 'SvelteStore<any>'.\n Overload 2 of 2, '(store: SvelteStore<any> | null | undefined): any', gave the following error.\n Argument of type 'string' is not assignable to parameter of type 'SvelteStore<any> | null | undefined'.",
14+
"message": "No overload matches this call.\n Overload 1 of 2, '(store: SvelteStore<any>): any', gave the following error.\n Argument of type 'string' is not assignable to parameter of type 'SvelteStore<any>'.\n Overload 2 of 2, '(store: SvelteStore<any> | null | undefined): any', gave the following error.\n Argument of type 'string' is not assignable to parameter of type 'SvelteStore<any>'.",
1515
"code": 2769,
1616
"tags": []
1717
},
1818
{
1919
"range": { "start": { "line": 8, "character": 1 }, "end": { "line": 8, "character": 14 } },
2020
"severity": 1,
2121
"source": "ts",
22-
"message": "No overload matches this call.\n Overload 1 of 2, '(store: SvelteStore<any>): any', gave the following error.\n Argument of type 'string' is not assignable to parameter of type 'SvelteStore<any>'.\n Overload 2 of 2, '(store: SvelteStore<any> | null | undefined): any', gave the following error.\n Argument of type '\"not a store\"' is not assignable to parameter of type 'SvelteStore<any> | null | undefined'.",
22+
"message": "No overload matches this call.\n Overload 1 of 2, '(store: SvelteStore<any>): any', gave the following error.\n Argument of type 'string' is not assignable to parameter of type 'SvelteStore<any>'.\n Overload 2 of 2, '(store: SvelteStore<any> | null | undefined): any', gave the following error.\n Argument of type 'string' is not assignable to parameter of type 'SvelteStore<any>'.",
2323
"code": 2769,
2424
"tags": []
2525
},
2626
{
2727
"range": { "start": { "line": 11, "character": 2 }, "end": { "line": 11, "character": 7 } },
2828
"severity": 1,
2929
"source": "ts",
30-
"message": "No overload matches this call.\n Overload 1 of 2, '(store: SvelteStore<any>): any', gave the following error.\n Argument of type 'string' is not assignable to parameter of type 'SvelteStore<any>'.\n Overload 2 of 2, '(store: SvelteStore<any> | null | undefined): any', gave the following error.\n Argument of type 'string' is not assignable to parameter of type 'SvelteStore<any> | null | undefined'.",
30+
"message": "No overload matches this call.\n Overload 1 of 2, '(store: SvelteStore<any>): any', gave the following error.\n Argument of type 'string' is not assignable to parameter of type 'SvelteStore<any>'.\n Overload 2 of 2, '(store: SvelteStore<any> | null | undefined): any', gave the following error.\n Argument of type 'string' is not assignable to parameter of type 'SvelteStore<any>'.",
3131
"code": 2769,
3232
"tags": []
3333
},
@@ -38,7 +38,7 @@
3838
},
3939
"severity": 1,
4040
"source": "ts",
41-
"message": "No overload matches this call.\n Overload 1 of 2, '(store: SvelteStore<any>): any', gave the following error.\n Argument of type 'string' is not assignable to parameter of type 'SvelteStore<any>'.\n Overload 2 of 2, '(store: SvelteStore<any> | null | undefined): any', gave the following error.\n Argument of type 'string' is not assignable to parameter of type 'SvelteStore<any> | null | undefined'.",
41+
"message": "No overload matches this call.\n Overload 1 of 2, '(store: SvelteStore<any>): any', gave the following error.\n Argument of type 'string' is not assignable to parameter of type 'SvelteStore<any>'.\n Overload 2 of 2, '(store: SvelteStore<any> | null | undefined): any', gave the following error.\n Argument of type 'string' is not assignable to parameter of type 'SvelteStore<any>'.",
4242
"code": 2769,
4343
"tags": []
4444
},
@@ -49,7 +49,7 @@
4949
},
5050
"severity": 1,
5151
"source": "ts",
52-
"message": "No overload matches this call.\n Overload 1 of 2, '(store: SvelteStore<any>): any', gave the following error.\n Argument of type 'string' is not assignable to parameter of type 'SvelteStore<any>'.\n Overload 2 of 2, '(store: SvelteStore<any> | null | undefined): any', gave the following error.\n Argument of type '\"not a store\"' is not assignable to parameter of type 'SvelteStore<any> | null | undefined'.",
52+
"message": "No overload matches this call.\n Overload 1 of 2, '(store: SvelteStore<any>): any', gave the following error.\n Argument of type 'string' is not assignable to parameter of type 'SvelteStore<any>'.\n Overload 2 of 2, '(store: SvelteStore<any> | null | undefined): any', gave the following error.\n Argument of type 'string' is not assignable to parameter of type 'SvelteStore<any>'.",
5353
"code": 2769,
5454
"tags": []
5555
}

packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/accessors-customElement-configs/expected.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
"range": { "start": { "line": 9, "character": 7 }, "end": { "line": 9, "character": 12 } },
44
"severity": 1,
55
"source": "ts",
6-
"message": "Type '\"\"' is not assignable to type 'number | undefined'.",
6+
"message": "Type 'string' is not assignable to type 'number'.",
77
"code": 2322,
88
"tags": []
99
},
1010
{
1111
"range": { "start": { "line": 9, "character": 15 }, "end": { "line": 9, "character": 20 } },
1212
"severity": 1,
1313
"source": "ts",
14-
"message": "Type '\"\"' is not assignable to type 'number | undefined'.",
14+
"message": "Type 'string' is not assignable to type 'number'.",
1515
"code": 2322,
1616
"tags": []
1717
},

0 commit comments

Comments
 (0)