Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jfmengels/elm-review-example
Example project using elm-review
https://github.com/jfmengels/elm-review-example
elm elm-review
Last synced: 2 months ago
JSON representation
Example project using elm-review
- Host: GitHub
- URL: https://github.com/jfmengels/elm-review-example
- Owner: jfmengels
- License: bsd-3-clause
- Created: 2019-09-17T18:35:49.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T02:48:38.000Z (about 2 years ago)
- Last Synced: 2024-05-01T12:20:25.786Z (8 months ago)
- Topics: elm, elm-review
- Language: Elm
- Homepage: https://package.elm-lang.org/packages/jfmengels/elm-lint/latest/
- Size: 315 KB
- Stars: 9
- Watchers: 4
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# elm-review-example
This repository is a very contrived package project, aiming to show how [elm-review](https://package.elm-lang.org/packages/jfmengels/elm-review/latest/) and the [CLI](https://www.npmjs.com/package/elm-review) are used in a project, and showcase the output by actually running them in your terminal.
## Configuration
Configuration lies in the `review/` directory. There is an `elm.json` which lists the dependencies containing review rules we wish to use. It also contains a `src/ReviewConfig.elm` file, in which we explicitly choose the rules we want to enable.
The imported rules come from the [review-unused](https://package.elm-lang.org/packages/jfmengels/review-unused/latest/), [review-common](https://package.elm-lang.org/packages/jfmengels/review-common/latest/), and [review-debug](https://package.elm-lang.org/packages/jfmengels/review-debug/latest/) packages in the Elm package registry.
## Custom rules
There are two custom rules in this project:
- [`NoDefiningColorsOutsideOfUiColor`](https://github.com/jfmengels/elm-review-example/blob/master/review/NoDefiningColorsOutsideOfUiColor.elm): This rule prevents defining colors (using `Css.hex`) outside of the `Ui.Color` module, which is the central location where we define colors in the application.
- [`NoUsingHtmlButton`](https://github.com/jfmengels/elm-review-example/blob/master/review/NoUsingHtmlButton.elm): This rule prevents users from using `Html.button` and `Html.Styled.button`, because we already have a great module to create buttons with the `Ui.Button`.Both rules are found in the `review/` directory. You can find their corresponding tests in `review/tests/`.
## Running it
You can run the review by running `npm run review`, which will run `elm-review`. This means it will run `elm-review` on all the Elm files in the project.
You can also run the fix mode by running `npm run review:fix`, which will run in effect run `elm-review --fix`.
## In a CI environment
You can see what `elm-review` looks like when run in a CI like Travis [here](https://travis-ci.com/jfmengels/elm-review-example).