Skip to content
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

Test folder is being ignored. #290

Open
AivarasBartasevicius opened this issue Jun 27, 2023 · 1 comment
Open

Test folder is being ignored. #290

AivarasBartasevicius opened this issue Jun 27, 2023 · 1 comment

Comments

@AivarasBartasevicius
Copy link

AivarasBartasevicius commented Jun 27, 2023

In my project structure, /src folder and /test folder are both seperate.
/project/src/...
/project/test/...
I export some of the code from /src to test it, and some of the exports only exist for the tests, but they are considered as unused exports by the ts-unused-exports. Seems like only the /src directory is being checked for code inside /src. I can add ignores, but that doesn't seem like a great solution for long term.

Is there any way how i can fix this, maybe different paths in tsconfig.json or something.
My current tsconfig.json include:
"include": ["src/**/*", "test/**/*", "types/**/*"]

Also tried using --ignoreLocallyUsed, hoping that the exported functions for tests would disappear from the error, considering that they are being called in the same file, but it didn't work.

"ts-unused-exports": "9.0.5",

@mrseanryan
Copy link
Collaborator

Possibly a bug - given test/**/* is in the "include".

Although not sure about this:

hoping that the exported functions for tests would disappear from the error, considering that they are being called in the same file, but it didn't work

If a function is used in the same file, it can still be an "unused export" if nothing outside that file is importing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants