Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alexkorban/elm-review-json-to-elm
elm-review rule to generate JSON decoders and encoders from a JSON string
https://github.com/alexkorban/elm-review-json-to-elm
Last synced: 13 days ago
JSON representation
elm-review rule to generate JSON decoders and encoders from a JSON string
- Host: GitHub
- URL: https://github.com/alexkorban/elm-review-json-to-elm
- Owner: alexkorban
- License: bsd-3-clause
- Created: 2021-06-02T06:09:05.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-11-29T08:26:23.000Z (about 3 years ago)
- Last Synced: 2024-11-09T22:54:31.439Z (about 2 months ago)
- Language: Elm
- Size: 87.9 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# elm-review-json-to-elm
Provides an [`elm-review`](https://package.elm-lang.org/packages/jfmengels/elm-review/latest/) rule to generate JSON decoders and encoders from a JSON sample in a `Debug.todo` string.
## Provided rules
- [`JsonToElm`](https://package.elm-lang.org/packages/alexkorban/elm-review-json-to-elm/1.0.1/JsonToElm/) - Finds JSON samples in `Debug.todo` strings and offers to generate JSON decoders and encoders from them. The JSON part of the string needs to be prefixed with `@json` to allow the rule to detect it.
## Configuration
```elm
module ReviewConfig exposing (config)import JsonToElm
import Review.Rule exposing (Rule)config : List Rule
config =
[ JsonToElm.rule
]
```## Try it out
You can try the example configuration above out by running the following command:
```bash
elm-review --template alexkorban/elm-review-json-to-elm/example
```