Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sparksp/elm-review-imports
elm-review rule to enforce consistent import aliases
https://github.com/sparksp/elm-review-imports
elm elm-review review-imports
Last synced: about 2 months ago
JSON representation
elm-review rule to enforce consistent import aliases
- Host: GitHub
- URL: https://github.com/sparksp/elm-review-imports
- Owner: sparksp
- License: mit
- Created: 2020-05-12T19:13:55.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-08-06T18:08:21.000Z (5 months ago)
- Last Synced: 2024-08-06T21:24:49.668Z (5 months ago)
- Topics: elm, elm-review, review-imports
- Language: Elm
- Homepage: https://package.elm-lang.org/packages/sparksp/elm-review-imports/latest/
- Size: 601 KB
- Stars: 14
- Watchers: 3
- Forks: 3
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# elm-review-imports
![elm package](https://img.shields.io/elm-package/v/sparksp/elm-review-imports)
![elm-review 2.10](https://img.shields.io/badge/elm--review-2.10-%231293D8)
![elm 0.19](https://img.shields.io/badge/elm-0.19-%231293D8)
![Tests](https://github.com/sparksp/elm-review-imports/workflows/Tests/badge.svg)Provides [`elm-review`](https://package.elm-lang.org/packages/jfmengels/elm-review/latest/) rules to enforce consistent import aliases.
## Provided rules
- [`NoInconsistentAliases`](https://package.elm-lang.org/packages/sparksp/elm-review-imports/1.0.2/NoInconsistentAliases) - enforce consistent aliases.
- [`NoModuleOnExposedNames`](https://package.elm-lang.org/packages/sparksp/elm-review-imports/1.0.2/NoModuleOnExposedNames) - forbid module on exposed names.## Configuration
```elm
import NoInconsistentAliases
import NoModuleOnExposedNames
import Review.Rule exposing (Rule)config : List Rule
config =
[ NoInconsistentAliases.config
[ ( "Html.Attributes", "Attr" )
, ( "Json.Decode", "Decode" )
, ( "Json.Encode", "Encode" )
]
|> NoInconsistentAliases.noMissingAliases
|> NoInconsistentAliases.rule
, NoModuleOnExposedNames.rule
]
```## Try it out
You can try the example configuration above out by running the following command:
```bash
elm-review --template sparksp/elm-review-imports/example
```