mirror of
https://github.com/sveltejs/svelte.git
synced 2024-11-21 19:38:58 +01:00
fix: tweak invalid dollar prefix rules around function args (#9792)
This commit is contained in:
parent
62c9292947
commit
e6b5ccd29a
5
.changeset/neat-dingos-clap.md
Normal file
5
.changeset/neat-dingos-clap.md
Normal file
@ -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…
Reference in New Issue
Block a user