elm-review CLI
Run [elm-review] from Node.js.
Installation
# Save it to your package.json, if you use npm in your project.
# This is the recommended way.
npm install elm-review --save-dev
# Install globally. This is not recommended.
npm install -g elm-reviewSee below if you want to try it out without installing it.
Usage
# Print the help
elm-review --help
# Review your project
elm-review
# Create an empty review configuration
elm-review init
# Create a new project containing elm-review rules
# aimed at being published on the Elm package registry
elm-review new-packageCreate an empty new rule to get started.
Very helpful for projects created with new-package
elm-review new-rule
## Try it out
You can try `elm-review` out without setting up anything!
First of all, if you have `node` installed, it comes with `npx`, which lets you run `elm-review` without installing it by prepending the command by `npx`, like `npx elm-review`. It is a bit slower and requires Internet access, but it's useful to try it out.
You can also run a configuration you found on GitHub, using the `--template` flag. Even if you already have a configuration, you can use this to try out the rules from a new package before adding them to your configuration.
For instance, if you want to find and remove the dead code in your project, you can use the [example configuration](https://github.com/jfmengels/elm-review-unused/tree/main/example) from the [`jfmengels/elm-review-unused` package](https://package.elm-lang.org/packages/jfmengels/elm-review-unused/latest/).
npx elm-review --template jfmengels/elm-review-unused/example
You can even use the configuration to fix all the errors that can be auto-fixed.
npx elm-review --template jfmengels/elm-review-unused/example --fix-all
If you are happy with the configuration, you can base your own configuration off of it, and then edit it:
npx elm-review init --template jfmengels/elm-review-unused/example
I **highly** recommend reading [this section on when to enable rules][when-to-write-or-enable-a-rule] in your configuration though.
You can use the same mechanics to try out a single rule before adding the dependency to your existing configuration and adding it to your configuration.
npx elm-review --template jfmengels/elm-review-unused/example --rules NoUnused.Variables