Files
test-repo/tests/format/vue/vue-3/script-generic.vue
T
auvred 7485c45bcc Add support for Vue "Generic Components" (#15066)
* add support for vue generic components

* add changelog and remove duplicated test case

* refactor

* rename file + simplify isVueScriptTag usage

* __isVueScriptGeneric -> __isEmbeddedTypescriptGenericParameters

* add link to blog post to changelog
2023-07-16 14:40:12 +09:00

32 lines
1.1 KiB
Vue

<script setup lang="ts" generic="T"></script>
<script setup lang="ts" generic="T extends Type1 & Type2 & (Type3 | Type4), U"></script>
<script setup lang="ts" generic="T extends Type1 & Type2 & (Type3 | Type4), U extends string | number | boolean"></script>
<script setup lang="ts" generic="T extends | 'loooooooooooooooooooooooooooooooooong' | 'looooooooooooooooooooooooooooooooooong', U extends LooooooooooooooooooooooooooooooooongType<AnotherLoooooooooooooooongType<NonNullable<Record<string, (Type1 & Type2 & (LoooooooooooooooooooooongType3 | LoooooooooooooooooooooongType4)) | null>[string]>>>, C" ></script>
<script setup lang="ts" generic="
// comment 1:
T
extends string &
'loooooooooooooooooooooooooooooooooooooooooooooooooooooooooong',
/**
* comment 2
*/
U extends number, // comment 3
/** comment 4 */ C extends MyType
"></script>
<template>
<!-- should not format it here -->
<not-script setup lang="ts" generic="T extends Type1 & Type2 & (Type3 | Type4), U extends string | number | boolean"></not-script>
</template>