You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What did you expect to happen?
There should be no reported violations of one-component-per-file.
What actually happened?
yarn run v1.22.5
$ eslint test.js
/home/markrian/dev/eslint-plugin-vue-bug/test.js
4:15 warning There is more than one component in this file vue/one-component-per-file
5:22 warning There is more than one component in this file vue/one-component-per-file
✖ 2 problems (0 errors, 2 warnings)
Done in 0.39s.
After looking into this a bit further, I think this false positive ultimately comes from this check:
// for Vue.js 3.x// app.component('xxx', {}) || app.mixin({})constisFullVueComponent=propName&&['component','mixin'].includes(propName)&&isObjectArgument(node)returnBoolean(isFullVueComponent)
And using component as the method name in my test case also yields a false positive.
There's a similar branch for Vue.js 2.x which checks that the callee object name is Vue, but for Vue 3, that's not possible, since the application instance could be called anything. It's not obvious to me how this heuristic could be tightened up to be strictly better... 🤔
Checklist
Tell us about your environment
Please show your full configuration:
What did you do?
and equally:
What did you expect to happen?
There should be no reported violations of one-component-per-file.
What actually happened?
Repository to reproduce this issue
https://gitlab.com/markrian/eslint-plugin-vue-one-component-per-file-bug
The text was updated successfully, but these errors were encountered: