All Projects → jfmengels → elm-review-unused

jfmengels / elm-review-unused

Licence: BSD-3-Clause License
Provides elm-review rules to detect unused elements in your Elm project

Programming Languages

elm
856 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to elm-review-unused

elm-review
Analyzes Elm projects, to help find mistakes before your users find them.
Stars: ✭ 195 (+983.33%)
Mutual labels:  elm-review
node-elm-review
CLI for elm-review
Stars: ✭ 34 (+88.89%)
Mutual labels:  elm-review

elm-review-unused

Provides elm-review rules to detect unused elements in your Elm project.

Provided rules

Example configuration

module ReviewConfig exposing (config)

import NoUnused.CustomTypeConstructorArgs
import NoUnused.CustomTypeConstructors
import NoUnused.Dependencies
import NoUnused.Exports
import NoUnused.Modules
import NoUnused.Parameters
import NoUnused.Patterns
import NoUnused.Variables
import Review.Rule exposing (Rule)


config : List Rule
config =
    [ NoUnused.CustomTypeConstructors.rule []
    , NoUnused.CustomTypeConstructorArgs.rule
    , NoUnused.Dependencies.rule
    , NoUnused.Exports.rule
    , NoUnused.Modules.rule
    , NoUnused.Parameters.rule
    , NoUnused.Patterns.rule
    , NoUnused.Variables.rule
    ]

How this package works

This package works by having several rules that check for different unused elements, and that complement each other.

This allows for fine-grained control over what you want the rules to do. If you add these rules to an existing project, you will likely get a lot of errors, and fixing them will take time (though the autofixing will definitely help). Instead, you can introduce these rules gradually in batches. For cases where the errors are too time-consuming to fix, you can ignore them in the configuration, until you take care of them.

A few of these rules provide automatic fixes using elm-review --fix or elm-review --fix-all.

Try it out

You can try the example configuration above out by running the following command:

elm-review --template jfmengels/elm-review-unused/example

Thanks

Thanks to @sparksp for writing NoUnused.Parameters and NoUnused.Patterns.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].