vastec / ember-unused-components

Search for unused components in your Ember project
51 stars 12 forks source link

Fix component path resolution for subpath that contains `*components/` #120

Open MikiDi opened 4 years ago

MikiDi commented 4 years ago

One of our projects has a sub-folder called web-components in the components folder. This lead to false component path resolution and false positives for unused components as a result. This PR fixes that.

tniezurawski commented 4 years ago

Are you sure it's the reason?

I've just created:

I didn't use it anywhere and it was listed. Then I used it on some view and it was no longer on the list 🤔

Maybe the problem is somewhere else 🤔

MikiDi commented 4 years ago

Hi,

thanks for checking this out. Quite sure it was. We have a pods layout, as well as folder-named components though, that may have to do with it.
A component

app/pods/components/web-components/alert/template.hbs
app/pods/components/web-components/alert/component.js

Always appeared as unused component

alert

After my change, it only appeared when unused as

web-components/alert

Hope that clarifies ...