Declutter your TypeScript project using Knip.
In this article, we will review how you can declutter your TypeScript project using Knip. We will look at:
-
Knip usage in Flyde
-
What is Flyde?
-
What is Knip?
Knip usage in Flyde
I found knip.json file in Flyde codebase. I wanted to learn more about this file. A quick google search tells me that Knip is an npm package that is used to declutter your TypeScript project.
{
"$schema": "https://unpkg.com/knip@5/schema.json",
"workspaces": {
"vscode": {
"entry": [
"src/test/*.ts"
],
"project": [
"src/**/*.{js,ts,tsx}",
"!src/test/**/*",
"!src/webview/**/*"
],
"ignoreDependencies": [
...
But at this point, you might be wondering what is Flyde.
What is Flyde?
Flyde is an open-source visual programming for backend logic that integrates with existing codebases. Flyde bridges the gap between technical and non-technical team members. Product managers, designers, and backend developers can collaborate on the same visual flows.
Learn more about Flyde.dev.
What is Knip?
Knip finds and fixes unused dependencies, exports and files in your JavaScript and TypeScript projects. Less code and dependencies lead to improved performance, less maintenance and easier refactorings.
-
Website: knip.dev
-
GitHub repo: webpro-nl/knip
-
npm package: knip
Installation
Run the following command to install Knip
npm init @knip/config
Now you can run Knip to lint your project:
npm run knip
About me:
Hey, my name is Ramu Narasinga. I study codebase architecture in large open-source projects.
Email: ramu.narasinga@gmail.com
Want to learn from open-source? Solve challenges inspired by open-source projects.