Skip to content

Commit

Permalink
fix(utils): also recognize .tsx files as Vue files (#2565)
Browse files Browse the repository at this point in the history
  • Loading branch information
haoqunjiang authored Oct 11, 2024
1 parent 2dc606c commit a91ae04
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}

/**
Expand Down
2 changes: 2 additions & 0 deletions tests/lib/utils/vue-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ ruleTester.run('vue-component', rule, {
},
...validTests('js'),
...validTests('jsx'),
...validTests('tsx'),
...validTests('vue')
],
invalid: [
Expand All @@ -356,6 +357,7 @@ ruleTester.run('vue-component', rule, {
},
...invalidTests('js'),
...invalidTests('jsx'),
...invalidTests('tsx'),
...invalidTests('vue')
]
})

0 comments on commit a91ae04

Please sign in to comment.