jfmengels / elm-review-documentation

Provides elm-review rules to help with the quality and correctness of your Elm project's documentation
https://package.elm-lang.org/packages/jfmengels/elm-review-documentation/latest/
BSD 3-Clause "New" or "Revised" License
6 stars 2 forks source link

New rule: Detect links to non-existing sections #3

Closed jfmengels closed 3 years ago

jfmengels commented 4 years ago

What the rule should do:

Detect links to non-existing sections/functions/types in the documentation, in the README and in the modules.

What problems does it solve:

This would help maintaining documentation (it would notice outdated documentation), and notice when you add a link with an error in the path to the section

I don't think the rule should provide an automatic fix, but I think it could provide suggestions ("Did you mean '#init'?")

Example of things the rule would report:

A [section](#section), if that section does not exist

Example of things the rule would not report:

# section

A [section](#section)

A [section](./ModuleName#section) from another file, if it exists in that file.

Link to image [](./image.png)
{-|
@docs init

Look at the [init](#init) function
-}

{-| the init function -}
init : Model
init = 1

When (not) to enable this rule:

If you are working on an application and it has no documentation?

I am looking for:

(More unorganized thoughts over at https://trello.com/c/BKfdmp8v/2-noinvalidreferences-noinvalidlinks-make-sure-that-all-references-to-sections-are-valid)

lue-bird commented 3 years ago

As you suggested: Please yoink lue-bird/elm-review-links-point-to-existing-package-members's rule for the module/definition link part.