Skip to content

Commit

Permalink
fix: camel case components is not recognized as used (#3377)
Browse files Browse the repository at this point in the history
Co-authored-by: Johnson Chu <johnsoncodehk@gmail.com>
  • Loading branch information
so1ve and johnsoncodehk authored Jul 13, 2023
1 parent fb501c2 commit 4809729
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/vue-language-core/src/generators/script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ declare function defineProp<T>(value?: T | (() => T), required?: boolean, rest?:
const templateStart = getLength(codes);
codes.push(varName);
const templateEnd = getLength(codes);
codes.push(`: {} as typeof `);
codes.push(`: ${varName} as typeof `);

const scriptStart = getLength(codes);
codes.push(varName);
Expand Down
1 change: 1 addition & 0 deletions packages/vue-test-workspace/vue-tsc/#3373/NavBar.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<script lang="ts" setup></script>
9 changes: 9 additions & 0 deletions packages/vue-test-workspace/vue-tsc/#3373/main.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<template>
<div>
<nav-bar></nav-bar>
</div>
</template>

<script lang="ts" setup>
import navBar from './NavBar.vue';
</script>
8 changes: 8 additions & 0 deletions packages/vue-test-workspace/vue-tsc/#3373/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "../tsconfig.base.json",
"compilerOptions": {
"importsNotUsedAsValues": "error",
"ignoreDeprecations": "5.0"
},
"include": ["**/*"]
}
1 change: 1 addition & 0 deletions packages/vue-tsc/tests/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ function runVueTsc(cwd: string) {
describe(`vue-tsc`, () => {
it(`vue-tsc no errors (non-strict-template)`, () => runVueTsc(path.resolve(workspace, './non-strict-template')), 40_000);
it(`vue-tsc no errors (strict-template)`, () => runVueTsc(path.resolve(workspace, './strict-template')), 40_000);
it(`vue-tsc no errors (#3373)`, () => runVueTsc(path.resolve(workspace, './#3373')), 40_000);
});

0 comments on commit 4809729

Please sign in to comment.