Move optional type annotations to variable_declarator
@@ -20,11 +20,16 @@ module.exports = grammar(require('tree-sitter-javascript/grammar'), {
// Overrides
- _pattern: ($, previous) => seq(
- previous,
- optional($.type_annotation)
+ variable_declarator: ($, previous) => seq(
+ $._pattern,
+ optional($.type_annotation),
+ optional(seq(
+ '=',
+ $._expression
+ ))
),
+
// Additions
type_annotation: $ => seq(
