Skip to content

Commit 5b8c283

Browse files
Add rule for map key shorthand
Closes #169.
1 parent a1ddb3a commit 5b8c283

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,6 +1185,18 @@ directives (see [Modules](#modules)).
11851185
some_value = [a: "baz", b: "qux"]
11861186
```
11871187

1188+
* <a name="map-key-atom"></a>
1189+
Use the shorthand key-value syntax for maps when all of the keys are atoms.
1190+
<sup>[[link](#map-key-atom)]</sup>
1191+
1192+
```elixir
1193+
# not preferred
1194+
%{:a => 1, :b => 2, :c => 0}
1195+
1196+
# preferred
1197+
%{a: 1, b: 2, c: 3}
1198+
```
1199+
11881200
### Strings
11891201

11901202
* <a name="strings-matching-with-concatenator"></a>

0 commit comments

Comments
 (0)