Skip to content

Commit a91ae04

Browse files
authored
fix(utils): also recognize .tsx files as Vue files (#2565)
1 parent 2dc606c commit a91ae04

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Diff for: lib/utils/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2681,7 +2681,7 @@ function markVariableAsUsed(context, name, node) {
26812681
* @param {string} path
26822682
*/
26832683
function isVueFile(path) {
2684-
return path.endsWith('.vue') || path.endsWith('.jsx')
2684+
return path.endsWith('.vue') || path.endsWith('.jsx') || path.endsWith('.tsx')
26852685
}
26862686

26872687
/**

Diff for: tests/lib/utils/vue-component.js

+2
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ ruleTester.run('vue-component', rule, {
339339
},
340340
...validTests('js'),
341341
...validTests('jsx'),
342+
...validTests('tsx'),
342343
...validTests('vue')
343344
],
344345
invalid: [
@@ -356,6 +357,7 @@ ruleTester.run('vue-component', rule, {
356357
},
357358
...invalidTests('js'),
358359
...invalidTests('jsx'),
360+
...invalidTests('tsx'),
359361
...invalidTests('vue')
360362
]
361363
})

0 commit comments

Comments
 (0)