Skip to content

Add elm-review rule NoExposingEverything

Overview

Add elm-review rule NoExposingEverything

This rule errors on any module that exposes everything, e.g. module MyMod exposing (..)

This does not, however, error on exposing all variants of a type, e.g. module MyMod exposing (MyType(..))

It also includes support for autofixing, elm-review --fix which will replace a (..) expose with all functions and types in that module.

-- ELM-REVIEW ERROR --------------------------------------- tests/Tests.elm:1:24

(fix) NoExposingEverything: Module exposes everything implicitly "(..)"

1| module Tests exposing ( .. )
                            ^^^^^

Modules should have hidden implementation details with an explicit API so that
the module is used in a proper and controlled way. The users of this module
should not have to know about what is inside a module it is using, and they
shouldn't need to access its internal details. Therefore, the API should be
explicitly defined and ideally as small as possible.

Errors marked with (fix) can be fixed automatically using `elm-review --fix`.

Discussion

I like this a lot, I always prefer to be explicit rather than implicit.

Merge request reports