https://github.com/jfmengels/elm-review-code-style
https://github.com/jfmengels/elm-review-code-style
code-style elm-review
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/jfmengels/elm-review-code-style
- Owner: jfmengels
- License: bsd-3-clause
- Created: 2021-02-10T13:49:02.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-09-11T08:04:33.000Z (over 1 year ago)
- Last Synced: 2025-06-18T05:41:56.487Z (6 months ago)
- Topics: code-style, elm-review
- Language: Elm
- Homepage: https://package.elm-lang.org/packages/jfmengels/elm-review-code-style/latest/
- Size: 283 KB
- Stars: 5
- Watchers: 3
- Forks: 3
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# elm-review-code-style
Provides [`elm-review`](https://package.elm-lang.org/packages/jfmengels/elm-review/latest/) rules to follow some of my personal code style preferences.
I tend to not have many rules related to code style thanks to using `elm-format` and Elm's simple language,
and I think that `elm-review` brings more values by reporting different kinds of issues than code style infringements,
but I do think that there are use-cases for it.
A few warnings before trying to add them to your review configuration.
1. These rules enforce opinions **I personally** have on "nicer" Elm code, and honestly they're mostly about resolving things I find relatively annoying. Do not enforce the ones you or your team disagrees with in your project.
2. These rules may be a source of more frustration (when the tests fails because of them) for your team and a source of work that will bring little value to your project. I try to provide fixes when I can to reduce that work though!
With that said, I recommend [trying them out](#try-it-out) to help you decide.
## Provided rules
- [🔧 `NoRedundantlyQualifiedType`](https://package.elm-lang.org/packages/jfmengels/elm-review-code-style/1.2.0/NoRedundantlyQualifiedType/) - Reports when a type is qualified by a module (alias) of the same name.
- [🔧 `NoSimpleLetBody`](https://package.elm-lang.org/packages/jfmengels/elm-review-code-style/1.2.0/NoSimpleLetBody/ "Provides automatic fixes") - Reports when a let expression's body is a simple reference to a value declared in the let expression.
- [🔧 `NoUnnecessaryTrailingUnderscore`](https://package.elm-lang.org/packages/jfmengels/elm-review-code-style/1.2.0/NoUnnecessaryTrailingUnderscore/ "Provides automatic fixes") - Reports unnecessary or suboptimal trailing underscores in variable names.
## Configuration
```elm
module ReviewConfig exposing (config)
import NoRedundantlyQualifiedType
import NoSimpleLetBody
import NoUnnecessaryTrailingUnderscore
import Review.Rule exposing (Rule)
config : List Rule
config =
[ NoUnnecessaryTrailingUnderscore.rule
, NoRedundantlyQualifiedType.rule
, NoSimpleLetBody.rule
]
```
## Try it out
You can try the example configuration above out by running the following command:
```bash
elm-review --template jfmengels/elm-review-code-style/example
```