# Intellij-elm now finds unused imports and dead code

**URL:** <https://discourse.elm-lang.org/t/intellij-elm-now-finds-unused-imports-and-dead-code/2921>\
**Category:** Show and Tell\
**Created:** [January 10, 2019, 6:08pm UTC](https://discourse.elm-lang.org/t/intellij-elm-now-finds-unused-imports-and-dead-code/2921 "2019-01-10T18:08:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![klazuka](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/klazuka/32/862_2.png) [@klazuka](https://discourse.elm-lang.org/u/klazuka)\
**Post date:** [January 10, 2019, 6:08pm UTC](https://discourse.elm-lang.org/t/intellij-elm-now-finds-unused-imports-and-dead-code/2921/1 "2019-01-10T18:08:43Z")

</div>

Version 2.2.0 of [the Elm plugin for IntelliJ](https://klazuka.github.io/intellij-elm/) adds several big new features:

1. Find (and remove) unused imports
2. Find dead code and unused parameters
3. Easily add/remove things from a module’s `exposing` list without losing your place

I made a video demonstrating the new features:

[https://youtu.be/FsoaYe-en7s](https://youtu.be/FsoaYe-en7s)

It’s not shown in the video, but you can run the “unused import” inspection over your entire project and click a single button to cleanup the imports across _all_ of your Elm files. **So even if you don’t normally use IntelliJ, you may want to give it a try just to do a one-off cleanup of your unused imports & dead code.**

Here’s what it looks like when optimizing imports across the entire project:  
 ![19%20PM](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex035/uploads/elm_lang/original/2X/b/bbad78eb71195cf606902c3f227341bf870e6144.png)

Questions? Feature Requests? Please create an issue on [klazuka/intellij-elm](https://github.com/klazuka/intellij-elm).

---

<div class="post-metadata">

**Author:** ![achauve](https://avatars.discourse-cdn.com/v4/letter/a/ea666f/32.png) [@achauve](https://discourse.elm-lang.org/u/achauve)\
**Post date:** [January 10, 2019, 8:24pm UTC](https://discourse.elm-lang.org/t/intellij-elm-now-finds-unused-imports-and-dead-code/2921/2 "2019-01-10T20:24:00Z")

</div>

Very great work, thanks a lot!

---

<div class="post-metadata">

**Author:** ![mika](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/mika/32/616_2.png) [@mika](https://discourse.elm-lang.org/u/mika)\
**Post date:** [January 11, 2019, 10:19pm UTC](https://discourse.elm-lang.org/t/intellij-elm-now-finds-unused-imports-and-dead-code/2921/3 "2019-01-11T22:19:29Z")

</div>

A huge thank you for the work you put into this! I used the new functionality and removed a bunch of dead code/imports the other day. It worked perfectly! And since elm-analyze is still missing for 0.19 there were an non-insignificant amount to get rid of. 😉 I may be partial since I cannot use anything but webstorm as a code editor but I believe you have created the best Elm dev experience!

---

<div class="post-metadata">

**Author:** ![jfmengels](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/jfmengels/32/3124_2.png) [@jfmengels](https://discourse.elm-lang.org/u/jfmengels)\
**Post date:** [January 11, 2019, 11:21pm UTC](https://discourse.elm-lang.org/t/intellij-elm-now-finds-unused-imports-and-dead-code/2921/4 "2019-01-11T23:21:45Z")

</div>

@mika elm-analyze is out with support for 0.19. But it doesn’t warn about unused exposed functions like this does (from what I’ve understood).

---

<div class="post-metadata">

**Author:** ![klazuka](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/klazuka/32/862_2.png) [@klazuka](https://discourse.elm-lang.org/u/klazuka)\
**Post date:** [January 13, 2019, 6:22pm UTC](https://discourse.elm-lang.org/t/intellij-elm-now-finds-unused-imports-and-dead-code/2921/5 "2019-01-13T18:22:16Z")

</div>

Actually, elm-analyze _does_ support finding [exposed functions that do not need to be exposed](https://stil4m.github.io/elm-analyse/#/messages/UnusedImportedVariable).

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/elm_lang/original/1X/50a05e53677a2c3b47776d7abd0f113eb50193a1.png) [@system](https://discourse.elm-lang.org/u/system)\
**Post date:** [January 23, 2019, 6:22pm UTC](https://discourse.elm-lang.org/t/intellij-elm-now-finds-unused-imports-and-dead-code/2921/6 "2019-01-23T18:22:18Z")

</div>

Closed on January 23, 2019, 6:22pm UTC

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
