File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
crates/oxc_linter/src/rules/vue Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -217,7 +217,13 @@ fn collect_hash_from_variable_declarator(
217217 let key_hash: FxHashSet < String > = obj_pattern
218218 . properties
219219 . iter ( )
220- . filter_map ( |prop| prop. key . static_name ( ) )
220+ . filter_map ( |prop| {
221+ if matches ! ( prop. value. kind, BindingPatternKind :: AssignmentPattern ( _) ) {
222+ prop. key . static_name ( )
223+ } else {
224+ None
225+ }
226+ } )
221227 . map ( |key| key. to_string ( ) )
222228 . collect ( ) ;
223229 Some ( key_hash)
@@ -407,6 +413,18 @@ fn test() {
407413 use std:: path:: PathBuf ;
408414
409415 let pass = vec ! [
416+ (
417+ r#"
418+ <script setup lang="ts">
419+ const { laps } = defineProps<{
420+ laps: unknown[];
421+ }>();
422+ </script>
423+ "# ,
424+ None ,
425+ None ,
426+ Some ( PathBuf :: from( "test.vue" ) ) ,
427+ ) ,
410428 (
411429 r#"
412430 <script setup lang="ts">
You can’t perform that action at this time.
0 commit comments