File tree Expand file tree Collapse file tree 3 files changed +25
-0
lines changed
test/fixtures/integrations/script-setup-with-typescript-eslint/no-unused-vars Expand file tree Collapse file tree 3 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -205,6 +205,12 @@ function analyzeUsedInTemplateVariables(
205205
206206 variable . references . push ( reference )
207207 reference . resolved = variable
208+
209+ if ( reference . isTypeReference ) {
210+ // @typescript -eslint/no-unused-vars treats type references at the same position as recursive references,
211+ // so without this flag it will be marked as unused.
212+ ; ( variable as any ) . eslintUsed = true
213+ }
208214 }
209215
210216 function processVExpressionContainer ( node : VExpressionContainer ) {
Original file line number Diff line number Diff line change 1+ {
2+ "rules" : {
3+ "@typescript-eslint/no-unused-vars" : " error"
4+ }
5+ }
Original file line number Diff line number Diff line change 1+ <script setup lang="ts">
2+ import MyComponent from " ./components/MyComponent.vue" ;
3+ interface Foo {
4+ foo? : string ;
5+ }
6+ type Bar = string ;
7+ </script >
8+
9+ <template >
10+ <MyComponent
11+ :foo =" {} as Foo"
12+ :bar =" 's' as Bar"
13+ />
14+ </template >
You can’t perform that action at this time.
0 commit comments