-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Perform dead code analysis with Knip (#2575)
* Install Knip * Clarify an import that was confusing Knip * Fix issues detected by Knip Including cleaning up some unused code and dependencies, using a React hook that we unintentionally stopped using, and also adding some previously undeclared dependencies. * Run dead code analysis in lint script and CI --------- Co-authored-by: Timo <[email protected]>
- Loading branch information
Showing
20 changed files
with
271 additions
and
774 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { KnipConfig } from "knip"; | ||
|
||
export default { | ||
entry: ["src/main.tsx", "i18next-parser.config.ts"], | ||
ignoreBinaries: [ | ||
// This is deprecated, so Knip doesn't actually recognize it as a globally | ||
// installed binary. TODO We should switch to Compose v2: | ||
// https://docs.docker.com/compose/migrate/ | ||
"docker-compose", | ||
], | ||
ignoreDependencies: [ | ||
// Used in CSS | ||
"normalize.css", | ||
// Used for its global type declarations | ||
"@types/grecaptcha", | ||
// Because we use matrix-js-sdk as a Git dependency rather than consuming | ||
// the proper release artifacts, and also import directly from src/, we're | ||
// forced to re-install some of the types that it depends on even though | ||
// these look unused to Knip | ||
"@types/content-type", | ||
"@types/sdp-transform", | ||
"@types/uuid", | ||
// We obviously use this, but if the package has been linked with yarn link, | ||
// then Knip will flag it as a false positive | ||
// https://github.com/webpro-nl/knip/issues/766 | ||
"@vector-im/compound-web", | ||
"matrix-widget-api", | ||
], | ||
ignoreExportsUsedInFile: true, | ||
} satisfies KnipConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.