Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/r-k-b/no-float-ids
A rule for elm-review that discourages the use of Float types for "Id" properties.
https://github.com/r-k-b/no-float-ids
Last synced: 26 days ago
JSON representation
A rule for elm-review that discourages the use of Float types for "Id" properties.
- Host: GitHub
- URL: https://github.com/r-k-b/no-float-ids
- Owner: r-k-b
- License: bsd-3-clause
- Created: 2020-03-06T09:19:44.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-06-17T01:41:20.000Z (6 months ago)
- Last Synced: 2024-06-17T02:45:54.254Z (6 months ago)
- Language: Elm
- Homepage: https://package.elm-lang.org/packages/r-k-b/no-float-ids/latest/
- Size: 110 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NoFloatIds
![.github/workflows/build.yml](https://github.com/r-k-b/no-float-ids/workflows/.github/workflows/build.yml/badge.svg)
A rule for elm-review that discourages the use of Float types for "Id"
properties.Not expected to be widely applicable; our use case is fairly niche, and
relates to legacy software.In the rare situation that generated Elm code isn't of the highest quality,
the `NoFloatIds` rule will help to enforce record properties that look like IDs
from being assigned `Float` types.For example, the following two Record type definitions would be marked as
Errors:```elm
type alias Foo =
{ qux : Qux
, someId : Float
}type alias Bar =
{ qux : Qux
, id : Float
}
```## Usage
After adding [`elm-review`][elm-review] to your project, import this rule from
your `ReviewConfig.elm` file and add it to the config. E.g.:```elm
import NoFloatIds
import Review.Rule exposing (Rule)config : List Rule
config =
[ NoFloatIds.rule ]
```[elm-review]: https://package.elm-lang.org/packages/jfmengels/elm-review/latest/