# `Shorthand.Check.Refactor.ShortenMaps`
[🔗](https://github.com/andrewtimberlake/shorthand/blob/1.3.1/lib/shorthand/check/refactor/shorten_maps.ex#L2)

## Basics

> #### This check is disabled by default. {: .neutral}
>
> [Learn how to enable it](`e:credo:config_file.html#checks`) via `.credo.exs`.

This check has a base priority of `normal` and works with any version of Elixir.

## Explanation

Prefer Shorthand map syntax for atom-key and string-key maps.

    %{foo: foo, bar: :baz}
    %{"foo" => foo, "bar" => :baz}

should be written as:

    m(foo, bar: :baz)
    sm(foo, bar: :baz)

Structs (`%Mod{}`) and maps inside `quote` blocks are ignored —
Shorthand macros cannot appear in quoted AST (use `st/2` for structs).

### Enable in `.credo.exs`:

    {Shorthand.Check.Refactor.ShortenMaps, []}

Pair with `Shorthand.Quokka.ShortenMaps` to auto-rewrite on `mix format`.

## Check-Specific Parameters

*There are no specific parameters for this check.*

## General Parameters

Like with all checks, [general params](`e:credo:check_params.html`) can be applied.

Parameters can be configured via the [`.credo.exs` config file](`e:credo:config_file.html`).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
