jfmengels / elm-review-unused

Provides elm-review rules to detect unused elements in your Elm project
https://package.elm-lang.org/packages/jfmengels/elm-review-unused/latest/
BSD 3-Clause "New" or "Revised" License
23 stars 12 forks source link

NoUnused.Exports: Remove the removed export from the module's documentation #20

Closed jfmengels closed 3 years ago

jfmengels commented 3 years ago

When NoUnused.Exports removes an element from a module, it doesn't remove the mention of the element from the module's documentation.

The idea would be, when removing c in the following excerpt, to go from

module A exposing (b, c, d)

{-|
@docs b, c, d
-}
import B

b = 1
c = 1
d = 1

to

module A exposing (b, d)

{-|
@docs b, d
-}
import B

b = 1
c = 1
d = 1

If c was on a line of its own, then the whole line would be removed. elm-format would remove the remaining extra lines if those appear.

{-|
@docs c -- this line would simply be removed.
@docs b, d
-}
jfmengels commented 3 years ago

elm-syntax does not have an easy way to get the documentation for a module, therefore this is not a trivial task.

Proposal to add that here: https://github.com/stil4m/elm-syntax/issues/151