-
-
Notifications
You must be signed in to change notification settings - Fork 421
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Johnson Chu <johnsoncodehk@gmail.com>
- Loading branch information
1 parent
b1ecfb8
commit 9bedf4b
Showing
10 changed files
with
154 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"private": true, | ||
"name": "@volar/vue-test-workspace-vue-2", | ||
"version": "1.0.0", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"vue": "^2.7.14", | ||
"vue-component-type-helpers": "1.8.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"compilerOptions": { | ||
"lib": [ | ||
"esnext", | ||
"dom" | ||
], | ||
"strict": true, | ||
"noUncheckedIndexedAccess": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"skipLibCheck": true, | ||
"allowJs": true, | ||
"jsx": "preserve", | ||
}, | ||
"include": [ | ||
"**/*" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// https://stackoverflow.com/a/53808212 | ||
type IfEquals<T, U, Y = unknown, N = never> = | ||
(<G>() => G extends T ? 1 : 2) extends | ||
(<G>() => G extends U ? 1 : 2) ? Y : N; | ||
export declare function exactType<T, U>(draft: T & IfEquals<T, U>, expected: U & IfEquals<T, U>): IfEquals<T, U>; | ||
|
||
// https://stackoverflow.com/a/49928360 | ||
type IfNotAny<T> = 0 extends 1 & T ? never : T; | ||
type IfNotUndefined<T> = Exclude<T, undefined> extends never ? never : T; | ||
export declare function isNotAnyOrUndefined<T>(value: IfNotAny<IfNotUndefined<T>>): void; |
19 changes: 19 additions & 0 deletions
19
packages/vue-test-workspace-vue-2/vue-tsc/strict-template/intrinsicProps/main.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<template> | ||
<div> | ||
<!-- FIXME: bug here --> | ||
<!-- @vue-expect-error --> | ||
<Foo class="123"></Foo> | ||
<div class="123"></div> | ||
</div> | ||
</template> | ||
<script lang="ts"> | ||
import { defineComponent } from 'vue'; | ||
const Foo = defineComponent({ | ||
props: { | ||
foo: String | ||
} | ||
}); | ||
</script> | ||
<script setup lang="ts"> | ||
</script> |
7 changes: 7 additions & 0 deletions
7
packages/vue-test-workspace-vue-2/vue-tsc/strict-template/tsconfig.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"extends": "../tsconfig.base.json", | ||
"vueCompilerOptions": { | ||
"strictTemplates": true | ||
}, | ||
"include": ["**/*"] | ||
} |
21 changes: 21 additions & 0 deletions
21
packages/vue-test-workspace-vue-2/vue-tsc/strict-template/unknownProp/main.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<template> | ||
<div> | ||
<!-- @vue-expect-error --> | ||
<Foo bar="123"></Foo> | ||
|
||
<!-- @vue-expect-error --> | ||
<div foo="123"></div> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { defineComponent } from 'vue'; | ||
const Foo = defineComponent({ | ||
props: { | ||
foo: String | ||
} | ||
}); | ||
</script> | ||
<script setup lang="ts"> | ||
</script> |
12 changes: 12 additions & 0 deletions
12
packages/vue-test-workspace-vue-2/vue-tsc/tsconfig.base.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"extends": "../tsconfig.json", | ||
"compilerOptions": { | ||
"noPropertyAccessFromIndexSignature": true, | ||
}, | ||
"vueCompilerOptions": { | ||
"target": 2.7, | ||
"jsxSlots": true, | ||
"plugins": ["../../vue-language-plugin-pug"] | ||
}, | ||
"include": [] | ||
} |
15 changes: 15 additions & 0 deletions
15
packages/vue-test-workspace/vue-tsc/strict-template/intrinsicProps/main.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<template> | ||
<Foo class="123"></Foo> | ||
|
||
<div class="123"></div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { defineComponent } from 'vue'; | ||
const Foo = defineComponent({ | ||
props: { | ||
foo: String | ||
} | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.