Skip to content

Commit 1986698

Browse files
Add rule for verbose map key-value syntax
1 parent 5b8c283 commit 1986698

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
@@ -1197,6 +1197,18 @@ directives (see [Modules](#modules)).
11971197
%{a: 1, b: 2, c: 3}
11981198
```
11991199

1200+
* <a name="map-key-arrow"></a>
1201+
Use the verbose key-value syntax for maps if any key is not an atom.
1202+
<sup>[[link](#map-key-arrow)]</sup>
1203+
1204+
```elixir
1205+
# not preferred
1206+
%{"c" => 0, a: 1, b: 2}
1207+
1208+
# preferred
1209+
%{:a => 1, :b => 2, "c" => 0}
1210+
```
1211+
12001212
### Strings
12011213

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

0 commit comments

Comments
 (0)