0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-11-25 09:09:35 +01:00

fix: tweak invalid dollar prefix rules around function args (#9792)

This commit is contained in:
Dominic Gannaway 2023-12-05 21:16:13 +00:00 committed by GitHub
parent 62c9292947
commit e6b5ccd29a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: tweak invalid dollar prefix rules around function args

View File

@ -73,7 +73,13 @@ export class Scope {
error(node, 'invalid-dollar-binding');
}
if (node.name.startsWith('$') && declaration_kind !== 'synthetic' && this.function_depth <= 1) {
if (
node.name.startsWith('$') &&
declaration_kind !== 'synthetic' &&
declaration_kind !== 'param' &&
declaration_kind !== 'rest_param' &&
this.function_depth <= 1
) {
error(node, 'invalid-dollar-prefix');
}