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

Detect and delete unused code using static analysis #21969

Closed
Tracked by #246
novocaine opened this issue Apr 28, 2022 · 3 comments
Closed
Tracked by #246

Detect and delete unused code using static analysis #21969

novocaine opened this issue Apr 28, 2022 · 3 comments

Comments

@novocaine
Copy link
Contributor

Your use case

For example - https://camchenry.com/blog/deleting-dead-code-in-typescript

We should consider running this in CI

Have you considered any alternatives?

No response

Additional context

No response

@SimonBrandner
Copy link
Contributor

Doing this for our project is rather tricky as ts-prune doesn't see into the upper layers to check whether or not an export is actually being used. It does check dependencies though, so if we run it in element-web, it will check all the underlying repos. That means that if we want to setup a GHA for this, we will have to clone element-web and all the layers below. This isn't a problem for element-web (surprisingly) and matrix-react-sdk (since we already do this there) though we don't do this in the matrix-js-sdk.

It will probably be necessary to do this in the matrix-js-sdk as not doing it there could result in the CI failing for the other repos but not for matrix-js-sdk itself

@SimonBrandner
Copy link
Contributor

This is blocked on matrix-org/matrix-react-sdk#8612

There are two PRs (matrix-org/matrix-react-sdk#9052 and #22830) which add GHAs for this but are blocked atm. This is because right now we have unused code which will be used by matrix-org/matrix-react-sdk#8612 once merged

@SimonBrandner
Copy link
Contributor

This is now done 🎉

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