Skip to content

Commit 2ff49a7

Browse files
Merge pull request #156 from ember-tooling/update-prettier
Update prettier
2 parents 51970d4 + 0fa9286 commit 2ff49a7

File tree

6 files changed

+1345
-1463
lines changed

6 files changed

+1345
-1463
lines changed

Diff for: .husky/pre-commit

-4
This file was deleted.

Diff for: .prettierignore

+5
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
# Highlight test fixtures
22
test/highlight/
3+
4+
*.yml
5+
*.yaml
6+
*.md
7+
*.json

Diff for: .yarn/releases/yarn-3.6.4.cjs

-874
This file was deleted.

Diff for: grammar.js

+31-27
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module.exports = grammar({
1414
$.mustache_statement,
1515
$.block_statement,
1616
$.element_node,
17-
$.text_node
17+
$.text_node,
1818
),
1919

2020
//
@@ -61,11 +61,11 @@ module.exports = grammar({
6161
choice(
6262
$.attribute_node,
6363
$.mustache_statement,
64-
alias($.comment, $.comment_statement)
65-
)
64+
alias($.comment, $.comment_statement),
65+
),
6666
),
6767
optional($.block_params),
68-
">"
68+
">",
6969
),
7070
element_node_end: ($) => seq("</", $.tag_name, ">"),
7171

@@ -78,17 +78,17 @@ module.exports = grammar({
7878
choice(
7979
$.attribute_node,
8080
$.mustache_statement,
81-
alias($.comment, $.comment_statement)
82-
)
81+
alias($.comment, $.comment_statement),
82+
),
8383
),
84-
"/>"
84+
"/>",
8585
),
8686

8787
// An "Element" is either a "normal" or "void" element
8888
element_node: ($) =>
8989
choice(
9090
seq($.element_node_start, repeat($._declaration), $.element_node_end),
91-
$.element_node_void
91+
$.element_node_void,
9292
),
9393

9494
attribute_name: () => /[^<>"'/={}()\s\.,!?|]+/,
@@ -102,18 +102,22 @@ module.exports = grammar({
102102
optional(
103103
seq(
104104
"=",
105-
choice($.concat_statement, $.number_literal, $.mustache_statement)
106-
)
107-
)
105+
choice(
106+
$.concat_statement,
107+
$.number_literal,
108+
$.mustache_statement,
109+
),
110+
),
111+
),
108112
),
109-
alias($._splattributes, $.attribute_name)
113+
alias($._splattributes, $.attribute_name),
110114
),
111115

112116
// Special attribute-value strings that can embed a mustache statement
113117
concat_statement: ($) =>
114118
choice(
115119
$._single_quote_concat_statement,
116-
$._double_quote_concat_statement
120+
$._double_quote_concat_statement,
117121
),
118122

119123
_single_quote_concat_statement: ($) =>
@@ -122,27 +126,27 @@ module.exports = grammar({
122126
repeat(
123127
choice(
124128
$._mustache_safe_single_quote_string_literal_content,
125-
$.mustache_statement
126-
)
129+
$.mustache_statement,
130+
),
127131
),
128-
"'"
132+
"'",
129133
),
130134
_double_quote_concat_statement: ($) =>
131135
seq(
132136
'"',
133137
repeat(
134138
choice(
135139
$._mustache_safe_double_quote_string_literal_content,
136-
$.mustache_statement
137-
)
140+
$.mustache_statement,
141+
),
138142
),
139-
'"'
143+
'"',
140144
),
141145

142146
_mustache_safe_string_literal: ($) =>
143147
choice(
144148
$._mustache_safe_single_quote_string_literal,
145-
$._mustache_safe_double_quote_string_literal
149+
$._mustache_safe_double_quote_string_literal,
146150
),
147151
_mustache_safe_single_quote_string_literal_content: () => /[^'\\{]+/,
148152
_mustache_safe_single_quote_string_literal: ($) =>
@@ -168,7 +172,7 @@ module.exports = grammar({
168172
$.boolean_literal,
169173
$.sub_expression,
170174
$.path_expression,
171-
$.identifier
175+
$.identifier,
172176
),
173177

174178
hash_pair: ($) =>
@@ -178,7 +182,7 @@ module.exports = grammar({
178182
seq(
179183
choice("{{", "{{~"),
180184
choice($._expression, $.helper_invocation),
181-
choice("}}", "~}}")
185+
choice("}}", "~}}"),
182186
),
183187

184188
sub_expression: ($) =>
@@ -190,13 +194,13 @@ module.exports = grammar({
190194
_arguments: ($) =>
191195
choice(
192196
seq(repeat1(field("argument", $._expression)), repeat($.hash_pair)),
193-
seq(repeat(field("argument", $._expression)), repeat1($.hash_pair))
197+
seq(repeat(field("argument", $._expression)), repeat1($.hash_pair)),
194198
),
195199

196200
helper_invocation: ($) =>
197201
seq(
198202
field("helper", choice($.identifier, $.path_expression)),
199-
$._arguments
203+
$._arguments,
200204
),
201205

202206
//
@@ -209,21 +213,21 @@ module.exports = grammar({
209213
field("path", $.identifier),
210214
$._arguments,
211215
optional($.block_params),
212-
choice("}}", "~}}")
216+
choice("}}", "~}}"),
213217
),
214218

215219
block_statement_end: ($) =>
216220
seq(
217221
choice("{{/", "{{~/"),
218222
field("path", $.identifier),
219-
choice("}}", "~}}")
223+
choice("}}", "~}}"),
220224
),
221225

222226
block_statement: ($) =>
223227
seq(
224228
$.block_statement_start,
225229
field("program", repeat($._declaration)),
226-
$.block_statement_end
230+
$.block_statement_end,
227231
),
228232
},
229233
});

Diff for: package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
],
1919
"scripts": {
2020
"build:local": "tree-sitter build -o parser/glimmer.so",
21+
"lint:fix": "prettier --write .",
2122
"generate": "tree-sitter generate",
2223
"install": "node-gyp-build",
2324
"parse": "tree-sitter parse",
@@ -30,7 +31,7 @@
3031
},
3132
"devDependencies": {
3233
"prebuildify": "^6.0.0",
33-
"prettier": "^2.8.8",
34+
"prettier": "^3.3.3",
3435
"release-plan": "^0.9.0",
3536
"tree-sitter-cli": "^0.22.6"
3637
},

0 commit comments

Comments
 (0)