Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit 157241d

Browse files
committed
🎨 Move rule to the repo
1 parent 9945c23 commit 157241d

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

grammars/javascript.cson

+16-12
Original file line numberDiff line numberDiff line change
@@ -968,12 +968,7 @@
968968
'name': 'keyword.operator.ternary.js'
969969
'patterns': [
970970
{
971-
'match': '(\\w+)(?=\\s*:)'
972-
'captures':
973-
'1':
974-
'patterns': [
975-
'include': '$self'
976-
]
971+
'include': '#prevent_object_keys_matching'
977972
}
978973
{
979974
'include': '$self'
@@ -1725,12 +1720,7 @@
17251720
'name': 'punctuation.definition.section.case-statement.js'
17261721
'patterns': [
17271722
{
1728-
'match': '(\\w+)(?=\\s*:)'
1729-
'captures':
1730-
'1':
1731-
'patterns': [
1732-
'include': '$self'
1733-
]
1723+
'include': '#prevent_object_keys_matching'
17341724
}
17351725
{
17361726
'include': '$self'
@@ -1753,3 +1743,17 @@
17531743
]
17541744
}
17551745
]
1746+
'prevent_object_keys_matching':
1747+
'patterns': [
1748+
{
1749+
# e.g. don't treat null as an object key in
1750+
# ? null :
1751+
# case null:
1752+
'match': '(\\w+)(?=\\s*:)'
1753+
'captures':
1754+
'1':
1755+
'patterns': [
1756+
'include': '$self'
1757+
]
1758+
}
1759+
]

0 commit comments

Comments
 (0)