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') } /** 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') ] })