-
-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ts-unused-exports
thinks my entire project is unused [.js extension]
#219
Comments
I'm sorry, but this title made me laugh. 😂 |
ts-unused-exports
thinks my entire project is unused.ts-unused-exports
thinks my entire project is unused [.js extension]
hi @gamesaucer I've opened a PR that tries to reproduce the problem: Indeed, including .js files is not something we currently support, but could be interesting to support it ... I have a few questions - if we can work together, we can figure it out ...
(my bad - I thought there was a index.
(my bad - I thought there was a index. thanks for your collaboration, |
ah - reading again. The source is index. |
update: added a itest to cover. Fixed by #220. We released that in 8.0.2 Closing, unless new info comes in - thank you. |
As it says in the title, according the the command output, every single export from every file in my project is unused. However, it has many imports and compiles just fine, so something strange is going on here.
I don't know if this is a configuration error or a bug, but either way, I'll give as much detail as I can in the hope that someone can find the issue and fix it / tell me how to work around it.
EDIT: I think it's caused by using a
.js
extension in my imports, but this is still valid TS and it's necessary to generate working JS code (JS requires that imports have the full filename including the extension, and the TS compiler doesn't add it when absent). This is a major oversight if this is indeed the reason it doesn't work.Package version: 8.0.0
Package installation location: Global, in
%appdata%\npm\node_modules
on myC:
drive.Project location: In
D:\xampp\htdocs\myproject
(I find placing the repo inside my webserver environment to be the most convenient way to debug my code)
Command used:
ts-unused-exports tsconfig.json
fromD:\xampp\htdocs\myproject
Project
package.json
:Project
tsconfig.json:
Import statement examples:
Project structure:
tsconfig.json
,package.json
,package-lock.json
,.eslintrc.json
,.eslintignore
,.gitignore
build/
folder, with all the.js
and.js.map
files generated when compiling.html/
folder, withindex.html
andmain.css
.src/
folderindex.ts
Game/
folderGame.ts
Entity/
,Component/
,System/
,UI/
folders, etc.(I'm not going to list all of them or all their contents, but this should give a decent impression of my project structure.)
The text was updated successfully, but these errors were encountered: