Unused default export - no warning
The same code in one project shows up as unused, in another it doesn't. Unused global symbol is enabled in both.
Why doesn't webstorm highlight the default export as unused here?
Here it works (Project A):

Here it doesn't (Project B) - note the export default is not underlined and doesn't show a hover warning:


请先登录再写评论。
Please check if the issue persists after repairing indexes (File > Invalidate caches, Invalidate and restart). If it does, please share a project that reproduces the issue.
Thanks for the reply. Invalidating the caches had no result unfortunately.
I'll see if I can reproduce it in a dummy project later on but I noticed something that might be the culprit.
Project B, in which it doesn't work is 'big'. I.e. the file resides 5 directories deep in src (e.g.: src/dir1/dir2/dir3/dir4/view-menu.tsx).
When I take this component out into src directly, the export is quickly marked as unused. Does this make any sense to you, Elena?
After some additional trial-and-error, I found that the 'bug' occurs when any directory has the name 'pages'.
Once I renamed pages to layouts, it correctly started giving me the warning. What's special about pages though?
I can replicate in another project straightaway by just naming a directory pages and putting a tsx in there. A default export will not be marked just as in my screenshot above. Once the pages directory gets renamed to something else, the warning appears.
Must be a result of fixing https://youtrack.jetbrains.com/issue/WEB-55186/Suppress-the-False-unused-export-warning-inside-the-pages-folder
yes, that's probably it - thanks Elena. Pinged the developer in that youtrack issue about how to solve it for non-nextjs projects.