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

pull/9771/head
Dominic Gannaway 1 year ago committed by GitHub
parent 62c9292947
commit e6b5ccd29a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

@ -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');
}

Loading…
Cancel
Save