<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/how-to-detect-dead-code-in-a-frontend-project-oqwgwn-j3" -->

---
title: How to detect dead code in a frontend project | daily.dev
description: Using ESLint to detect and remove dead code in your frontend project.Using webpack for dead code detection.Using TypeScript to detect dead code.Detect unused...
canonical: https://daily.dev/posts/how-to-detect-dead-code-in-a-frontend-project-oqwgwn-j3
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: How to detect dead code in a frontend project | daily.dev
og:description: Using ESLint to detect and remove dead code in your frontend project.Using webpack for dead code detection.Using TypeScript to detect dead code.Detect unused...
og:url: https://daily.dev/posts/how-to-detect-dead-code-in-a-frontend-project-oqwgwn-j3
og:image: https://api.daily.dev/og/posts/OqwGWN_j3.png
og:image:alt: How to detect dead code in a frontend project
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How to detect dead code in a frontend project

**[LogRocket](https://daily.dev/sources/logrocket)** · [@ivakop](https://daily.dev/ivakop) · 7 min read · 184 upvotes · 9 comments

## Summary

Using ESLint to detect and remove dead code in your frontend project.Using webpack for dead code detection.Using TypeScript to detect dead code.Detect unused dependencies with depcheck.Using the no-unused-vars rule to detect unused variables in our files.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.logrocket.com/how-detect-dead-code-frontend-project/>

## Community discussion

Top comments from developers on daily.dev.

**@ghost** · 1 upvotes

> The mighty combo of ESLint + Webpack + TypeScript 💪

**@flide** · 1 upvotes

> Using tsconfig and ts-prune to make sure the codebase does not contain any component that is not being used.

**@eddyar** · 0 upvotes

> Nice! ts-prune now implemented on mu project :)

**@croat\_kurd** · 0 upvotes

> Great

**@iamstan13y** · 0 upvotes

> very useful 👍

## Similar posts on daily.dev

- [Don’t just attend KubeCon \+ CloudNativeCon, Merge Forward your experience\!](https://daily.dev/posts/don-t-just-attend-kubecon-cloudnativecon-merge-forward-your-experience--l0rpp73x8) · CNCF · 1 upvotes · 0 comments
- [Announcing H2 2026 KCDs](https://daily.dev/posts/announcing-h2-2026-kcds-m96goajm1) · CNCF · 1 upvotes · 0 comments
- [Two months of Open Community Groups](https://daily.dev/posts/two-months-of-open-community-groups-asf52zhbs) · CNCF · 0 upvotes · 0 comments

---

Tags: [#general-programming](https://daily.dev/tags/general-programming), [#javascript](https://daily.dev/tags/javascript), [#typescript](https://daily.dev/tags/typescript), [#webdev](https://daily.dev/tags/webdev)

[View this post on daily.dev](https://daily.dev/posts/how-to-detect-dead-code-in-a-frontend-project-oqwgwn-j3)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"How to detect dead code in a frontend project","url":"https://daily.dev/posts/how-to-detect-dead-code-in-a-frontend-project-oqwgwn-j3","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/how-to-detect-dead-code-in-a-frontend-project-oqwgwn-j3"},"datePublished":"2022-04-26T14:35:49.286Z","dateModified":"2026-03-15T02:24:28.569Z","description":"Using ESLint to detect and remove dead code in your frontend project.Using webpack for dead code detection.Using TypeScript to detect dead code.Detect unused...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/53159193eb4a3455186339b8b6782677","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/53159193eb4a3455186339b8b6782677","isAccessibleForFree":true,"articleSection":"LogRocket","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Person","name":"Iva","url":"https://daily.dev/ivakop","image":"https://avatars.githubusercontent.com/u/25869467?v=4","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":130}},"commentCount":9,"discussionUrl":"https://daily.dev/posts/how-to-detect-dead-code-in-a-frontend-project-oqwgwn-j3","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":184},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":9}],"keywords":"general-programming,javascript,typescript,webdev","timeRequired":"PT7M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"LogRocket","item":"https://daily.dev/sources/logrocket"},{"@type":"ListItem","position":3,"name":"How to detect dead code in a frontend project"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/how-to-detect-dead-code-in-a-frontend-project-oqwgwn-j3","comment":[{"@type":"Comment","text":"The mighty combo of ESLint + Webpack + TypeScript 💪","datePublished":"2022-04-28T06:43:53.592Z","url":"https://daily.dev/posts/OqwGWN_j3#c-ObpzCi3zr","author":{"@type":"Person","name":"Deleted user","url":"https://daily.dev/ghost","image":"https://media.daily.dev/image/upload/s--hNIUzLiO--/f_auto/v1705327420/public/ghost_vlftth"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}},{"@type":"Comment","text":"Using tsconfig and ts-prune to make sure the codebase does not contain any component that is not being used.","datePublished":"2022-04-28T16:32:43.202Z","url":"https://daily.dev/posts/OqwGWN_j3#c-5rWlAAvpo","author":{"@type":"Person","name":"Ravi Agarwal","url":"https://daily.dev/flide","image":"https://lh3.googleusercontent.com/a-/AOh14GgrdPI-jQtbq67Lk6-a-qouUNNAzoSB8J7yTGaZQA=s100"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}},{"@type":"Comment","text":"Nice! ts-prune now implemented on mu project :)","datePublished":"2022-04-28T01:28:55.452Z","url":"https://daily.dev/posts/OqwGWN_j3#c-45innOthd","author":{"@type":"Person","name":"eddyar","url":"https://daily.dev/eddyar","image":"https://avatars.githubusercontent.com/u/16196612?v=4"}},{"@type":"Comment","text":"Great","datePublished":"2022-04-28T11:16:03.545Z","url":"https://daily.dev/posts/OqwGWN_j3#c-RHAMDTJ7M","author":{"@type":"Person","name":"ANGRY MAN","url":"https://daily.dev/croat_kurd","image":"https://lh3.googleusercontent.com/a-/AOh14GhNJDnko3ULv0879lKyH8Yo_4F1Nj9hss-MIgIt=s100"}},{"@type":"Comment","text":"very useful 👍","datePublished":"2022-04-26T17:09:42.072Z","url":"https://daily.dev/posts/OqwGWN_j3#c-0zADCQJmH","author":{"@type":"Person","name":"Keith Stanley","url":"https://daily.dev/iamstan13y","image":"https://media.daily.dev/image/upload/s--P7OIZZWU--/f_auto/v1718725825/avatars/avatar_6vJuBB62B"}}]}
```

