From e743eca6550a1602e9e7e4521dadb65ce7c18340 Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Sat, 21 Sep 2024 19:27:43 +0800 Subject: [PATCH 1/2] fix(utils): also recognize .tsx files as Vue files --- lib/utils/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils/index.js b/lib/utils/index.js index c31f2d6af..58cd32689 100644 --- a/lib/utils/index.js +++ b/lib/utils/index.js @@ -2681,7 +2681,7 @@ function markVariableAsUsed(context, name, node) { * @param {string} path */ function isVueFile(path) { - return path.endsWith('.vue') || path.endsWith('.jsx') + return path.endsWith('.vue') || path.endsWith('.jsx') || path.endsWith('.tsx') } /** From 81183bade07678d278b6fd2f0d95cff8f4e7e94e Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Sat, 28 Sep 2024 22:18:12 +0800 Subject: [PATCH 2/2] test: add test case for .tsx components --- tests/lib/utils/vue-component.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/lib/utils/vue-component.js b/tests/lib/utils/vue-component.js index 9beffdb82..8970672ad 100644 --- a/tests/lib/utils/vue-component.js +++ b/tests/lib/utils/vue-component.js @@ -339,6 +339,7 @@ ruleTester.run('vue-component', rule, { }, ...validTests('js'), ...validTests('jsx'), + ...validTests('tsx'), ...validTests('vue') ], invalid: [ @@ -356,6 +357,7 @@ ruleTester.run('vue-component', rule, { }, ...invalidTests('js'), ...invalidTests('jsx'), + ...invalidTests('tsx'), ...invalidTests('vue') ] })