diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 95e79cdf..ba5c20b5 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -22,7 +22,7 @@ jobs: node-version: ${{vars.NODE_VERSION}} - name: Install modules run: npm ci --legacy-peer-deps - - name: Run ESLint + - name: Run ESLint linter run: npm run lint - - name: Run Prettier + - name: Run ESLint formatter run: npm run format diff --git a/eslint.config.mjs b/eslint.config.mjs index 4201aa7d..494a10eb 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,4 +1,5 @@ import treesitter from 'eslint-config-treesitter'; -import prettier from 'eslint-config-prettier'; -export default [...treesitter, prettier]; +export default [ + ...treesitter, +]; diff --git a/grammar.js b/grammar.js index f2f132bf..6cf52131 100644 --- a/grammar.js +++ b/grammar.js @@ -1,13 +1,14 @@ /// // @ts-check + module.exports = grammar({ name: 'nu', - word: ($) => $.identifier, + word: $ => $.identifier, - extras: ($) => [/[ \t]/, $.comment], + extras: $ => [/[ \t]/, $.comment], - inline: ($) => [ + inline: $ => [ $._flag_value, $._item_expression, $._match_expression, @@ -18,13 +19,13 @@ module.exports = grammar({ $._terminator, ], - externals: ($) => [ + externals: $ => [ $.raw_string_begin, $.raw_string_content, $.raw_string_end, ], - conflicts: ($) => [ + conflicts: $ => [ [$._binary_predicate_parenthesized], [$._block_body, $.record_body, $.val_closure], [$._block_body, $.shebang], @@ -59,15 +60,15 @@ module.exports = grammar({ rules: { /// File - nu_script: ($) => seq(optional($.shebang), optional($._block_body)), + nu_script: $ => seq(optional($.shebang), optional($._block_body)), - shebang: ($) => seq(optional($._repeat_newline), '#!', /.*\r?\n?/), + shebang: $ => seq(optional($._repeat_newline), '#!', /.*\r?\n?/), ...block_body_rules(), ...parenthesized_body_rules(), - _block_body: ($) => + _block_body: $ => general_body_rules( '', $._block_body_statement, @@ -81,7 +82,7 @@ module.exports = grammar({ // NOTE: // probably needs an external scanner for cmd_identifier // to behave exactly the same as the nushell parser - cmd_identifier: ($) => { + cmd_identifier: $ => { const excluded = '\\[\\]\\{}<>="`\':,'; const pattern_repeat = repeat(none_of(excluded)); const pattern_suffix = token.immediate(repeat1(none_of(excluded))); @@ -115,18 +116,18 @@ module.exports = grammar({ ), ); }, - identifier: (_$) => _identifier_rules(false), + identifier: _ => _identifier_rules(false), - long_flag_identifier: (_$) => + long_flag_identifier: _ => token.immediate(/[0-9\p{XID_Start}_][\p{XID_Continue}?_-]*/), - _command_name: ($) => + _command_name: $ => choice( field('unquoted_name', $.cmd_identifier), field('quoted_name', $.val_string), ), - _variable_name: ($) => + _variable_name: $ => choice( field('var_name', $.identifier), field('dollar_name', $.val_variable), @@ -134,19 +135,19 @@ module.exports = grammar({ // remove newline characters from extras to reduce ambiguity // manually controlled by adding the following to parenthesized rules - _newline: (_$) => /\r?\n/, - _repeat_newline: ($) => repeat1($._newline), - _space: (_$) => /[ \t]+/, - _separator: ($) => choice($._space, $._newline), - _terminator: ($) => choice(';', $._newline), - _pipe_separator: ($) => + _newline: _ => /\r?\n/, + _repeat_newline: $ => repeat1($._newline), + _space: _ => /[ \t]+/, + _separator: $ => choice($._space, $._newline), + _terminator: $ => choice(';', $._newline), + _pipe_separator: $ => repeat1(seq(optional($._repeat_newline), choice('|', ...redir_pipe()))), /// Attributes - attribute_list: ($) => repeat1(seq($.attribute, choice(';', $._newline))), - attribute_identifier: (_$) => + attribute_list: $ => repeat1(seq($.attribute, choice(';', $._newline))), + attribute_identifier: _ => token.immediate(/[0-9\p{XID_Start}][0-9\p{XID_Continue}_-]*/), - attribute: ($) => + attribute: $ => seq( '@', field('type', $.attribute_identifier), @@ -154,7 +155,7 @@ module.exports = grammar({ ), /// Top Level Items - decl_def: ($) => + decl_def: $ => seq( optional($.attribute_list), optional(modifier().visibility), @@ -167,9 +168,9 @@ module.exports = grammar({ field('body', $.block), ), - decl_export: ($) => seq(keyword().export_env, field('body', $.block)), + decl_export: $ => seq(keyword().export_env, field('body', $.block)), - decl_extern: ($) => + decl_extern: $ => seq( optional($.attribute_list), optional(modifier().visibility), @@ -179,7 +180,7 @@ module.exports = grammar({ field('body', optional($.block)), ), - decl_module: ($) => + decl_module: $ => seq( optional(modifier().visibility), keyword().module, @@ -187,7 +188,7 @@ module.exports = grammar({ optional(field('body', $.block)), ), - decl_use: ($) => + decl_use: $ => seq( optional(modifier().visibility), keyword().use, @@ -196,19 +197,19 @@ module.exports = grammar({ ), /// Return types - returns: ($) => seq(optional(':'), choice($._multiple_types, $._one_type)), + returns: $ => seq(optional(':'), choice($._multiple_types, $._one_type)), - _one_type: ($) => seq($._type_annotation, '->', $._type_annotation), + _one_type: $ => seq($._type_annotation, '->', $._type_annotation), - _types_body: ($) => + _types_body: $ => general_body_rules('', $._one_type, $._entry_separator, $._newline), - _multiple_types: ($) => + _multiple_types: $ => seq(brack().open_brack, optional($._types_body), brack().close_brack), /// Parameters - parameter_parens: ($) => + parameter_parens: $ => seq( brack().open_paren, optional($._repeat_newline), @@ -216,7 +217,7 @@ module.exports = grammar({ brack().close_paren, ), - parameter_bracks: ($) => + parameter_bracks: $ => seq( brack().open_brack, optional($._repeat_newline), @@ -224,10 +225,10 @@ module.exports = grammar({ brack().close_brack, ), - parameter_pipes: ($) => + parameter_pipes: $ => seq('|', optional($._repeat_newline), repeat($.parameter), '|'), - parameter: ($) => + parameter: $ => seq( choice( $._param_name, @@ -240,7 +241,7 @@ module.exports = grammar({ repeat(choice($._newline, ',')), ), - _param_name: ($) => + _param_name: $ => choice( field('param_rest', $.param_rest), field('param_optional', $.param_opt), @@ -248,7 +249,7 @@ module.exports = grammar({ field('param_short_flag', $.param_short_flag), ), - param_type: ($) => + param_type: $ => seq( optional($._repeat_newline), ':', @@ -257,7 +258,7 @@ module.exports = grammar({ field('completion', optional($.param_completer)), ), - param_value: ($) => + param_value: $ => seq( optional($._repeat_newline), '=', @@ -272,23 +273,23 @@ module.exports = grammar({ ), ), - _type_annotation: ($) => + _type_annotation: $ => field( 'type', choice($.list_type, $.collection_type, $.flat_type, $.composite_type), ), - _all_type: ($) => + _all_type: $ => field( 'type', choice($.list_type, $.collection_type, $.flat_type, $.composite_type), ), - flat_type: (_$) => field('flat_type', flat_types()), + flat_type: _ => field('flat_type', flat_types()), - _collection_annotation: ($) => + _collection_annotation: $ => seq(':', $._all_type, field('completion', optional($.param_completer))), - _collection_entry: ($) => + _collection_entry: $ => seq( field( 'key', @@ -299,14 +300,14 @@ module.exports = grammar({ ), optional($._collection_annotation), ), - _collection_body: ($) => + _collection_body: $ => general_body_rules( '', $._collection_entry, $._entry_separator, $._newline, ), - collection_type: ($) => + collection_type: $ => seq( choice('record', 'table'), token.immediate(brack().open_angle), @@ -314,7 +315,7 @@ module.exports = grammar({ brack().close_angle, ), - list_type: ($) => + list_type: $ => seq( 'list', token.immediate(brack().open_angle), @@ -323,9 +324,9 @@ module.exports = grammar({ brack().close_angle, ), - _composite_argument_body: ($) => + _composite_argument_body: $ => general_body_rules('', $._all_type, $._entry_separator, $._newline), - composite_type: ($) => + composite_type: $ => seq( 'oneof', token.immediate(brack().open_angle), @@ -333,7 +334,7 @@ module.exports = grammar({ brack().close_angle, ), - param_completer: ($) => + param_completer: $ => seq( token.immediate('@'), choice( @@ -345,34 +346,34 @@ module.exports = grammar({ ), ), - param_rest: ($) => seq('...', optional('$'), field('name', $.identifier)), + param_rest: $ => seq('...', optional('$'), field('name', $.identifier)), - param_opt: ($) => seq(field('name', $.identifier), token.immediate('?')), + param_opt: $ => seq(field('name', $.identifier), token.immediate('?')), - param_long_flag: ($) => seq(operator().long_flag, $.long_flag_identifier), + param_long_flag: $ => seq(operator().long_flag, $.long_flag_identifier), - flag_capsule: ($) => + flag_capsule: $ => seq(brack().open_paren, $.param_short_flag, brack().close_paren), - param_short_flag: ($) => + param_short_flag: $ => seq(operator().minus, field('name', $.param_short_flag_identifier)), - param_short_flag_identifier: (_$) => + param_short_flag_identifier: _ => token.immediate(/[\p{Punctuation}\p{Symbol}\p{XID_Continue}]/), /// Controls // control statements cannot be used in pipeline because they // do not return values - _ctrl_statement: ($) => choice($.ctrl_for, $.ctrl_loop, $.ctrl_while), + _ctrl_statement: $ => choice($.ctrl_for, $.ctrl_loop, $.ctrl_while), // control expressions *return values and can be used in pipelines // // * `break` and `continue` do not return values (yet?) but can be // used in pipelines - _ctrl_expression: ($) => choice($.ctrl_if, $.ctrl_try, $.ctrl_match), + _ctrl_expression: $ => choice($.ctrl_if, $.ctrl_try, $.ctrl_match), - _ctrl_expression_parenthesized: ($) => + _ctrl_expression_parenthesized: $ => choice( alias($.ctrl_if_parenthesized, $.ctrl_if), alias($.ctrl_try_parenthesized, $.ctrl_try), @@ -381,7 +382,7 @@ module.exports = grammar({ // Standalone Controls - ctrl_for: ($) => + ctrl_for: $ => seq( keyword().for, field('looping_var', $._variable_name), @@ -390,9 +391,9 @@ module.exports = grammar({ field('body', $.block), ), - ctrl_loop: ($) => seq(keyword().loop, field('body', $.block)), + ctrl_loop: $ => seq(keyword().loop, field('body', $.block)), - ctrl_while: ($) => + ctrl_while: $ => seq( keyword().while, field('condition', $._expression), @@ -402,7 +403,7 @@ module.exports = grammar({ ctrl_if: _ctrl_if_rule(false), ctrl_if_parenthesized: _ctrl_if_rule(true), - _ctrl_match_body: ($) => + _ctrl_match_body: $ => general_body_rules( '', choice($.match_arm, $.default_arm), @@ -410,7 +411,7 @@ module.exports = grammar({ $._newline, ), - ctrl_match: ($) => + ctrl_match: $ => seq( keyword().match, field( @@ -422,24 +423,24 @@ module.exports = grammar({ brack().close_brace, ), - match_arm: ($) => + match_arm: $ => seq( field('pattern', $.match_pattern), '=>', field('expression', $._match_expression), ), - default_arm: ($) => + default_arm: $ => seq( field('default_pattern', '_'), '=>', field('expression', $._match_expression), ), - _match_expression: ($) => + _match_expression: $ => choice($._item_expression, prec.dynamic(10, $.block)), - match_pattern: ($) => + match_pattern: $ => choice( seq('_', $.match_guard), seq($._match_pattern, optional($.match_guard)), @@ -449,15 +450,15 @@ module.exports = grammar({ ), ), - _match_pattern: ($) => + _match_pattern: $ => choice($._match_pattern_expression, alias($.unquoted, $.val_string)), - match_guard: ($) => seq(keyword().if, $._expression), + match_guard: $ => seq(keyword().if, $._expression), - _match_pattern_expression: ($) => + _match_pattern_expression: $ => choice($._match_pattern_value, $.val_range, $.expr_parenthesized), - _match_pattern_value: ($) => + _match_pattern_value: $ => choice( $.val_variable, $.val_nothing, @@ -473,7 +474,7 @@ module.exports = grammar({ $.val_table, ), - _match_pattern_list_body: ($) => + _match_pattern_list_body: $ => general_body_rules( 'entry', choice( @@ -486,7 +487,7 @@ module.exports = grammar({ choice($._newline, ','), ), - _match_pattern_list: ($) => + _match_pattern_list: $ => seq( brack().open_brack, optional(alias($._match_pattern_list_body, $.list_body)), @@ -502,10 +503,10 @@ module.exports = grammar({ brack().close_brack, ), - _match_pattern_rest: ($) => + _match_pattern_rest: $ => seq(operator().range_inclusive, seq(token.immediate('$'), $.identifier)), - _match_pattern_record_body: ($) => + _match_pattern_record_body: $ => general_body_rules( 'entry', choice($.record_entry, $.val_variable), @@ -513,7 +514,7 @@ module.exports = grammar({ $._newline, ), - _match_pattern_record: ($) => + _match_pattern_record: $ => seq( brack().open_brace, optional(alias($._match_pattern_record_body, $.record_body)), @@ -526,7 +527,7 @@ module.exports = grammar({ /// Pipelines - pipe_element: ($) => + pipe_element: $ => choice( seq( _env_variable_rule(false, $), @@ -538,7 +539,7 @@ module.exports = grammar({ $.where_command, ), - pipe_element_parenthesized: ($) => + pipe_element_parenthesized: $ => choice( seq( _env_variable_rule(true, $), @@ -556,16 +557,16 @@ module.exports = grammar({ /// Scope Statements - scope_pattern: ($) => + scope_pattern: $ => choice( field('wildcard', $.wild_card), $._command_name, field('command_list', $.command_list), ), - wild_card: (_$) => token('*'), + wild_card: _ => token('*'), - _command_list_body: ($) => + _command_list_body: $ => general_body_rules( 'cmd', $._command_name, @@ -573,7 +574,7 @@ module.exports = grammar({ $._newline, ), - command_list: ($) => + command_list: $ => seq( brack().open_brack, optional($._command_list_body), @@ -582,12 +583,12 @@ module.exports = grammar({ /// Block - block: ($) => + block: $ => seq(brack().open_brace, optional($._block_body), brack().close_brace), - _blosure: ($) => choice($.block, $.val_closure), + _blosure: $ => choice($.block, $.val_closure), - _where_predicate_lhs_path_head: ($) => + _where_predicate_lhs_path_head: $ => seq( choice( token(prec(prec_map().low, repeat1(none_of('\\[\\]{}.,:?!')))), @@ -598,7 +599,7 @@ module.exports = grammar({ // the where command has a unique argument pattern that breaks the // general command parsing, so we handle it separately - _where_predicate_lhs: ($) => + _where_predicate_lhs: $ => seq(alias($._where_predicate_lhs_path_head, $.path), repeat($.path)), where_command: _where_clause_rule(false), @@ -607,7 +608,7 @@ module.exports = grammar({ _binary_predicate: _binary_predicate_rule(false), _binary_predicate_parenthesized: _binary_predicate_rule(true), - where_predicate: ($) => + where_predicate: $ => choice( $.val_bool, $.val_variable, @@ -644,7 +645,7 @@ module.exports = grammar({ /// Expressions - _expression: ($) => + _expression: $ => choice( $._value, $.expr_binary, @@ -653,7 +654,7 @@ module.exports = grammar({ $.expr_parenthesized, ), - _expression_parenthesized: ($) => + _expression_parenthesized: $ => choice( $._value, $.expr_unary, @@ -664,7 +665,7 @@ module.exports = grammar({ /// Composite Expressions - expr_unary: ($) => { + expr_unary: $ => { const after_not = choice( $.val_bool, $.expr_parenthesized, @@ -680,7 +681,7 @@ module.exports = grammar({ ); }, - _expr_unary_minus: ($) => + _expr_unary_minus: $ => seq( token(operator().minus), seq( @@ -695,7 +696,7 @@ module.exports = grammar({ expr_binary: _expr_binary_rule(false), expr_binary_parenthesized: _expr_binary_rule(true), - _expr_binary_expression: ($) => + _expr_binary_expression: $ => choice( $._value, $.val_range, @@ -704,7 +705,7 @@ module.exports = grammar({ $.expr_parenthesized, ), - _expr_binary_expression_parenthesized: ($) => + _expr_binary_expression_parenthesized: $ => choice( $._value, $.val_range, @@ -713,7 +714,7 @@ module.exports = grammar({ $.expr_parenthesized, ), - expr_parenthesized: ($) => + expr_parenthesized: $ => seq( brack().open_paren, optional($._parenthesized_body), @@ -721,7 +722,7 @@ module.exports = grammar({ optional($.cell_path), ), - _spread_parenthesized: ($) => + _spread_parenthesized: $ => seq( brack().spread_open_paren, optional($._parenthesized_body), @@ -729,14 +730,14 @@ module.exports = grammar({ optional($.cell_path), ), - _expr_parenthesized_immediate: ($) => + _expr_parenthesized_immediate: $ => seq( token.immediate(brack().open_paren), optional($._parenthesized_body), brack().close_paren, ), - _parenthesized_body: ($) => + _parenthesized_body: $ => general_body_rules( '', $._block_body_statement_parenthesized, @@ -756,7 +757,7 @@ module.exports = grammar({ /// Simple Expressions - _value: ($) => + _value: $ => choice( $.val_variable, $.val_cellpath, @@ -776,33 +777,33 @@ module.exports = grammar({ ), /// Literals - val_nothing: (_$) => + val_nothing: _ => choice( special().null, seq(token(brack().open_paren), token.immediate(brack().close_paren)), ), - val_bool: (_$) => choice(special().true, special().false), + val_bool: _ => choice(special().true, special().false), - _spread_variable: ($) => + _spread_variable: $ => seq('...$', field('name', $.identifier), optional($.cell_path)), - val_variable: ($) => + val_variable: $ => seq( '$', field('name', choice('nu', 'in', 'env', $.identifier)), optional($.cell_path), ), - val_cellpath: ($) => seq('$', $.cell_path), + val_cellpath: $ => seq('$', $.cell_path), - val_number: ($) => $._val_number, + val_number: $ => $._val_number, _val_number_decimal: _decimal_rule(false), // separating floats from integers does not end well // especially when it comes to incorporation with ranges. - _val_number: ($) => + _val_number: $ => choice( $._val_number_decimal, /0x[0-9a-fA-F_]+/, @@ -813,13 +814,13 @@ module.exports = grammar({ special().not_a_number, ), - val_duration: ($) => + val_duration: $ => seq( field('value', alias($._val_number_decimal, $.val_number)), field('unit', $.duration_unit), ), - val_filesize: ($) => + val_filesize: $ => choice( // "0b" as single terminal in both $.val_binary and $.val_number // not able to further split it into value and unit @@ -831,7 +832,7 @@ module.exports = grammar({ ), // prettier-ignore - filesize_unit: (_$) => token.immediate(choice( + filesize_unit: _ => token.immediate(choice( 'b', 'B', 'kb', 'kB', 'Kb', 'KB', @@ -850,11 +851,11 @@ module.exports = grammar({ )), // prettier-ignore - duration_unit: (_$) => token.immediate(choice( + duration_unit: _ => token.immediate(choice( 'ns', 'µs', 'us', 'ms', 'sec', 'min', 'hr', 'day', 'wk', )), - val_binary: ($) => + val_binary: $ => seq( choice('0b', '0o', '0x'), token.immediate(brack().open_brack), @@ -862,9 +863,9 @@ module.exports = grammar({ brack().close_brack, ), - hex_digit: (_$) => token(/[0-9a-fA-F]+/), + hex_digit: _ => token(/[0-9a-fA-F]+/), - val_date: (_$) => + val_date: _ => token( choice( /[0-9]{4}-[0-9]{2}-[0-9]{2}/i, @@ -872,7 +873,7 @@ module.exports = grammar({ ), ), - _stringish: ($) => + _stringish: $ => choice( $.val_string, $.val_interpolated, @@ -880,7 +881,7 @@ module.exports = grammar({ $.val_variable, ), - val_string: ($) => + val_string: $ => choice( $._str_double_quotes, $._str_single_quotes, @@ -888,14 +889,14 @@ module.exports = grammar({ $._raw_str, ), - _raw_str: ($) => + _raw_str: $ => seq( $.raw_string_begin, alias($.raw_string_content, $.string_content), $.raw_string_end, ), - string_content: ($) => + string_content: $ => repeat1( choice( $._escaped_str_content, @@ -904,22 +905,22 @@ module.exports = grammar({ ), ), - _str_double_quotes: ($) => seq('"', optional($.string_content), '"'), + _str_double_quotes: $ => seq('"', optional($.string_content), '"'), - _escaped_str_content: (_$) => + _escaped_str_content: _ => token.immediate(prec(prec_map().string, /[^"\\]+/)), - _str_single_quotes: ($) => + _str_single_quotes: $ => seq( - "'", + '\'', alias( token.immediate(prec(prec_map().string, /[^']*/)), $.string_content, ), - token.immediate("'"), + token.immediate('\''), ), - _str_back_ticks: ($) => + _str_back_ticks: $ => seq( '`', alias( @@ -929,7 +930,7 @@ module.exports = grammar({ token.immediate('`'), ), - escape_sequence: (_$) => + escape_sequence: _ => token.immediate( seq( '\\', @@ -944,28 +945,28 @@ module.exports = grammar({ /// String Interpolation - val_interpolated: ($) => + val_interpolated: $ => choice($._inter_single_quotes, $._inter_double_quotes), - escaped_interpolated_content: (_$) => + escaped_interpolated_content: _ => token.immediate(prec(prec_map().string, /[^"\\(]+/)), - unescaped_interpolated_content: (_$) => + unescaped_interpolated_content: _ => token.immediate(prec(prec_map().string, /[^'(]+/)), - _inter_single_quotes: ($) => + _inter_single_quotes: $ => seq( - "$'", + '$\'', repeat( choice( field('expr', $.expr_interpolated), $.unescaped_interpolated_content, ), ), - token.immediate("'"), + token.immediate('\''), ), - _inter_double_quotes: ($) => + _inter_double_quotes: $ => seq( '$"', repeat( @@ -979,7 +980,7 @@ module.exports = grammar({ token.immediate('"'), ), - inter_escape_sequence: (_$) => + inter_escape_sequence: _ => token.immediate( seq( '\\', @@ -993,12 +994,12 @@ module.exports = grammar({ ), ), - expr_interpolated: ($) => + expr_interpolated: $ => seq(brack().open_paren, $._parenthesized_body, brack().close_paren), /// Collections - val_list: ($) => + val_list: $ => seq( brack().open_brack, optional($.list_body), @@ -1006,7 +1007,7 @@ module.exports = grammar({ optional($.cell_path), ), - _spread_list: ($) => + _spread_list: $ => seq( brack().spread_open_brack, optional($.list_body), @@ -1014,14 +1015,14 @@ module.exports = grammar({ optional($.cell_path), ), - _spread_listish: ($) => + _spread_listish: $ => choice( alias($._spread_list, $.val_list), alias($._spread_variable, $.val_variable), alias($._spread_parenthesized, $.expr_parenthesized), ), - list_body: ($) => + list_body: $ => general_body_rules( 'entry', $.val_entry, @@ -1031,7 +1032,7 @@ module.exports = grammar({ choice($._newline, ','), ), - val_entry: ($) => + val_entry: $ => prec( 10, field( @@ -1045,10 +1046,10 @@ module.exports = grammar({ ), ), - _item_expression: ($) => + _item_expression: $ => choice($._value, $.val_range, $.expr_parenthesized), - val_record: ($) => + val_record: $ => seq( brack().open_brace, optional($.record_body), @@ -1056,7 +1057,7 @@ module.exports = grammar({ optional($.cell_path), ), - _spread_record: ($) => + _spread_record: $ => seq( brack().spread_open_brace, optional($.record_body), @@ -1064,14 +1065,14 @@ module.exports = grammar({ optional($.cell_path), ), - _spread_recordish: ($) => + _spread_recordish: $ => choice( alias($._spread_record, $.val_record), alias($._spread_variable, $.val_variable), alias($._spread_parenthesized, $.expr_parenthesized), ), - record_body: ($) => + record_body: $ => general_body_rules( 'entry', $.record_entry, @@ -1079,9 +1080,9 @@ module.exports = grammar({ $._newline, ), - _entry_separator: (_$) => token(prec(prec_map().higher, choice(',', /\s/))), + _entry_separator: _ => token(prec(prec_map().higher, choice(',', /\s/))), - record_entry: ($) => + record_entry: $ => choice( field('spread', $._spread_recordish), seq( @@ -1114,7 +1115,7 @@ module.exports = grammar({ ), ), - _record_key: (_$) => { + _record_key: _ => { const excluded = '\\[\\]{}"`\':,'; const pattern_repeat = repeat(none_of(excluded)); // This distinguish number and identifier starting with -/+ @@ -1124,20 +1125,20 @@ module.exports = grammar({ ); }, - _table_head_separator: (_$) => + _table_head_separator: _ => token(prec(prec_map().higher, seq(/\s*/, ';'))), - _table_head: ($) => + _table_head: $ => seq( optional($._repeat_newline), field('head', $.val_list), alias($._table_head_separator, ';'), ), - _table_body: ($) => + _table_body: $ => general_body_rules('row', $.val_list, $._entry_separator, $._newline), - val_table: ($) => + val_table: $ => seq( brack().open_brack, $._table_head, @@ -1146,7 +1147,7 @@ module.exports = grammar({ optional($.cell_path), ), - val_closure: ($) => + val_closure: $ => seq( brack().open_brace, optional($._repeat_newline), @@ -1157,11 +1158,11 @@ module.exports = grammar({ /// CellPaths - cell_path: ($) => repeat1($.path), + cell_path: $ => repeat1($.path), - _path_suffix: ($) => choice('?', '!', seq('?', '!'), seq('!', '?')), + _path_suffix: $ => choice('?', '!', seq('?', '!'), seq('!', '?')), - path: ($) => { + path: $ => { const path = choice( token.immediate(prec(prec_map().low, repeat(none_of('\\[\\]{}.,:?!')))), $.val_string, @@ -1172,7 +1173,7 @@ module.exports = grammar({ /// Single-use env variables: FOO=BAR cmd - env_var: ($) => + env_var: $ => seq( field('variable', alias($.cmd_identifier, $.identifier)), token.immediate('='), @@ -1191,7 +1192,7 @@ module.exports = grammar({ command: _command_rule(false), _command_parenthesized: _command_rule(true), - _cmd_arg: ($) => + _cmd_arg: $ => choice( field('redir', prec.right(10, $.redirection)), field('flag', prec.right(9, $._flag)), @@ -1204,9 +1205,9 @@ module.exports = grammar({ field('arg_str', alias($._unquoted_with_expr, $.val_string)), ), - flag_value: ($) => choice($._value, $.val_string), + flag_value: $ => choice($._value, $.val_string), - redirection: ($) => + redirection: $ => seq( choice(...redir_append()), $._space, @@ -1216,52 +1217,52 @@ module.exports = grammar({ ), ), - _flag: ($) => choice($.short_flag, $.long_flag), + _flag: $ => choice($.short_flag, $.long_flag), - _flags_parenthesized: ($) => seq(repeat1($._separator), $._flag), + _flags_parenthesized: $ => seq(repeat1($._separator), $._flag), - _flag_value: ($) => + _flag_value: $ => choice( $._value, alias($.unquoted, $.val_string), alias($._expr_parenthesized_immediate, $.expr_parenthesized), ), - _flag_equals_value: ($) => + _flag_equals_value: $ => seq(token.immediate('='), field('value', $._flag_value)), - short_flag: ($) => + short_flag: $ => seq( operator().minus, optional(field('name', $.short_flag_identifier)), optional($._flag_equals_value), ), - short_flag_identifier: (_$) => + short_flag_identifier: _ => token.immediate(/[\p{XID_Continue}:?@!%_-]+/), - long_flag: ($) => + long_flag: $ => seq( operator().long_flag, optional(field('name', $.long_flag_identifier)), optional($._flag_equals_value), ), - _unquoted_pattern: (_$) => + _unquoted_pattern: _ => token.immediate( prec( prec_map().lowest, repeat1(none_of(_unquoted_pattern_rule('command', false))), ), ), - _unquoted_pattern_in_list: (_$) => + _unquoted_pattern_in_list: _ => token.immediate( prec( prec_map().lowest, repeat1(none_of(_unquoted_pattern_rule('list', false))), ), ), - _unquoted_pattern_in_record: (_$) => + _unquoted_pattern_in_record: _ => token.immediate( prec( prec_map().lowest, @@ -1269,7 +1270,7 @@ module.exports = grammar({ ), ), - _unquoted_naive: (_$) => + _unquoted_naive: _ => token(prec(prec_map().low, repeat1(none_of('{}')))), unquoted: _unquoted_rule('command'), _unquoted_in_list: _unquoted_rule('list'), @@ -1279,7 +1280,7 @@ module.exports = grammar({ _unquoted_in_list_with_expr: _unquoted_with_expr_rule('list'), _unquoted_in_record_with_expr: _unquoted_with_expr_rule('record'), - _unquoted_anonymous_prefix: ($) => + _unquoted_anonymous_prefix: $ => choice( special().null, alias($.val_bool, '_prefix'), @@ -1295,7 +1296,7 @@ module.exports = grammar({ /// Comments - comment: (_$) => seq('#', /.*/), + comment: _ => seq('#', /.*/), }, }); @@ -1353,7 +1354,7 @@ function parenthesized_body_rules() { /// pipeline - pipeline_parenthesized: ($) => + pipeline_parenthesized: $ => seq( repeat( seq( @@ -1376,7 +1377,7 @@ function block_body_rules() { /// pipeline - pipeline: ($) => + pipeline: $ => seq( repeat(seq($.pipe_element, $._pipe_separator, optional($._newline))), $.pipe_element, @@ -1579,14 +1580,14 @@ function _ctrl_try_rule(parenthesized) { keyword().try, field('try_branch', $.block), optional( - parenthesized - ? _insert_newline($, seq_catch_array, true, false) - : seq(...seq_catch_array), + parenthesized ? + _insert_newline($, seq_catch_array, true, false) : + seq(...seq_catch_array), ), ]; - return parenthesized - ? _insert_newline($, seq_array, false, false) - : seq(...seq_array); + return parenthesized ? + _insert_newline($, seq_array, false, false) : + seq(...seq_array); }; } @@ -1611,14 +1612,14 @@ function _ctrl_if_rule(parenthesized) { field('condition', _expr), field('then_branch', $.block), optional( - parenthesized - ? _insert_newline($, seq_else_array, true, false) - : seq(...seq_else_array), + parenthesized ? + _insert_newline($, seq_else_array, true, false) : + seq(...seq_else_array), ), ]; - return parenthesized - ? _insert_newline($, seq_array, false, false) - : seq(...seq_array); + return parenthesized ? + _insert_newline($, seq_array, false, false) : + seq(...seq_array); }; } @@ -1627,9 +1628,9 @@ function _ctrl_if_rule(parenthesized) { */ function _expr_binary_rule(parenthesized) { return (/** @type {any} */ $) => { - const _expr = parenthesized - ? $._expr_binary_expression_parenthesized - : $._expr_binary_expression; + const _expr = parenthesized ? + $._expr_binary_expression_parenthesized : + $._expr_binary_expression; return choice( ...table().map(([precedence, opr]) => { const seq_array = [ @@ -1644,9 +1645,9 @@ function _expr_binary_rule(parenthesized) { ), ), ]; - return parenthesized - ? prec.left(precedence, _insert_newline($, seq_array)) - : prec.left(precedence, seq(...seq_array)); + return parenthesized ? + prec.left(precedence, _insert_newline($, seq_array)) : + prec.left(precedence, seq(...seq_array)); }), ); }; @@ -1657,9 +1658,9 @@ function _expr_binary_rule(parenthesized) { */ function _binary_predicate_rule(parenthesized) { return (/** @type {any} */ $) => { - const _expr = parenthesized - ? $._binary_predicate_parenthesized - : $._binary_predicate; + const _expr = parenthesized ? + $._binary_predicate_parenthesized : + $._binary_predicate; return choice( ...binary().map(([precedence, opr]) => { const seq_array = [ @@ -1667,9 +1668,9 @@ function _binary_predicate_rule(parenthesized) { field('opr', opr), field('rhs', choice($.where_predicate, _expr)), ]; - return parenthesized - ? prec.left(precedence, _insert_newline($, seq_array)) - : prec.left(precedence, seq(...seq_array)); + return parenthesized ? + prec.left(precedence, _insert_newline($, seq_array)) : + prec.left(precedence, seq(...seq_array)); }), ); }; @@ -1688,17 +1689,17 @@ function _where_clause_rule(parenthesized) { $.where_predicate, $.val_closure, alias( - parenthesized - ? $._binary_predicate_parenthesized - : $._binary_predicate, + parenthesized ? + $._binary_predicate_parenthesized : + $._binary_predicate, $.where_predicate, ), ), ), ]; - return parenthesized - ? prec.left(_insert_newline($, seq_array)) - : seq(...seq_array); + return parenthesized ? + prec.left(_insert_newline($, seq_array)) : + seq(...seq_array); }; } @@ -1762,8 +1763,8 @@ function _range_rule(anonymous) { }; }; - const { opr, step: opr_step } = create_opr(false); - const { opr: opr_imm, step: opr_step_imm } = create_opr(true); + const {opr, step: opr_step} = create_opr(false); + const {opr: opr_imm, step: opr_step_imm} = create_opr(true); return (/** @type {any} */ $) => { const member = choice( @@ -1806,7 +1807,7 @@ function _range_rule(anonymous) { * @param {string} type */ function _unquoted_with_expr_rule(type) { - return ($) => { + return $ => { let excluded = ''; let unquoted_head = $.unquoted; switch (type) { @@ -1877,7 +1878,7 @@ function _unquoted_rule(type) { // picked as the a last resort after everything else has failed. // so we give it a ridiculously low precedence and place it at the // very end - return ($) => { + return $ => { let pattern_repeat1 = $._unquoted_pattern; switch (type) { case 'list': diff --git a/package-lock.json b/package-lock.json index 33c394d6..51c0d188 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,11 +14,9 @@ "node-gyp-build": "^4.8.4" }, "devDependencies": { - "eslint": "^9.36.0", - "eslint-config-prettier": "^10.1.8", + "eslint": "^9.39.1", "eslint-config-treesitter": "^1.0.2", "prebuildify": "^6.0.1", - "prettier": "^3.6.2", "tree-sitter-cli": "^0.25.9" }, "peerDependencies": { @@ -80,9 +78,9 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", - "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", "dev": true, "license": "MIT", "engines": { @@ -90,13 +88,13 @@ } }, "node_modules/@eslint/config-array": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.0.tgz", - "integrity": "sha512-ENIdc4iLu0d93HeYirvKmrzshzofPw6VkZRKQGe9Nv46ZnWUzcF1xV01dcvEg/1wXUR61OmmlSfyeyO7EvjLxQ==", + "version": "0.21.1", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.1.tgz", + "integrity": "sha512-aw1gNayWpdI/jSYVgzN5pL0cfzU02GT3NBpeT/DXbx1/1x7ZKxFPd9bwrzygx/qiwIQiJ1sw/zD8qY/kRvlGHA==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@eslint/object-schema": "^2.1.6", + "@eslint/object-schema": "^2.1.7", "debug": "^4.3.1", "minimatch": "^3.1.2" }, @@ -105,19 +103,22 @@ } }, "node_modules/@eslint/config-helpers": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.3.1.tgz", - "integrity": "sha512-xR93k9WhrDYpXHORXpxVL5oHj3Era7wo6k/Wd8/IsQNnZUTzkGS29lyn3nAT05v6ltUuTFVCCYDEGfy2Or/sPA==", + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz", + "integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==", "dev": true, "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.17.0" + }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@eslint/core": { - "version": "0.15.2", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.15.2.tgz", - "integrity": "sha512-78Md3/Rrxh83gCxoUc0EiciuOHsIITzLy53m3d9UyiW8y9Dj2D29FeETqyKA+BRK76tnTp6RXWb3pCay8Oyomg==", + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz", + "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -128,9 +129,9 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.1.tgz", - "integrity": "sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.3.tgz", + "integrity": "sha512-Kr+LPIUVKz2qkx1HAMH8q1q6azbqBAsXJUxBl/ODDuVPX45Z9DfwB8tPjTi6nNZ8BuM3nbJxC5zCAg5elnBUTQ==", "dev": true, "license": "MIT", "dependencies": { @@ -140,7 +141,7 @@ "globals": "^14.0.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", + "js-yaml": "^4.1.1", "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" }, @@ -152,9 +153,9 @@ } }, "node_modules/@eslint/js": { - "version": "9.36.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.36.0.tgz", - "integrity": "sha512-uhCbYtYynH30iZErszX78U+nR3pJU3RHGQ57NXy5QupD4SBVwDeU8TNBy+MjMngc1UyIW9noKqsRqfjQTBU2dw==", + "version": "9.39.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.1.tgz", + "integrity": "sha512-S26Stp4zCy88tH94QbBv3XCuzRQiZ9yXofEILmglYTh/Ug/a9/umqvgFtYBAo3Lp0nsI/5/qH1CCrbdK3AP1Tw==", "dev": true, "license": "MIT", "engines": { @@ -165,9 +166,9 @@ } }, "node_modules/@eslint/object-schema": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.6.tgz", - "integrity": "sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==", + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz", + "integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==", "dev": true, "license": "Apache-2.0", "engines": { @@ -175,13 +176,13 @@ } }, "node_modules/@eslint/plugin-kit": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.3.5.tgz", - "integrity": "sha512-Z5kJ+wU3oA7MMIqVR9tyZRtjYPr4OC004Q4Rw7pgOKUOKkJfZ3O24nz3WYfGRpMDNmcOi3TwQOmgm7B7Tpii0w==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz", + "integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@eslint/core": "^0.15.2", + "@eslint/core": "^0.17.0", "levn": "^0.4.1" }, "engines": { @@ -255,9 +256,9 @@ "license": "MIT" }, "node_modules/@typescript-eslint/types": { - "version": "8.44.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.44.0.tgz", - "integrity": "sha512-ZSl2efn44VsYM0MfDQe68RKzBz75NPgLQXuGypmym6QVOWL5kegTZuZ02xRAT9T+onqvM6T8CdQk0OwYMB6ZvA==", + "version": "8.49.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.49.0.tgz", + "integrity": "sha512-e9k/fneezorUo6WShlQpMxXh8/8wfyc+biu6tnAqA81oWrEic0k21RHzP9uqqpyBBeBKu4T+Bsjy9/b8u7obXQ==", "dev": true, "license": "MIT", "engines": { @@ -553,26 +554,25 @@ } }, "node_modules/eslint": { - "version": "9.36.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.36.0.tgz", - "integrity": "sha512-hB4FIzXovouYzwzECDcUkJ4OcfOEkXTv2zRY6B9bkwjx/cprAq0uvm1nl7zvQ0/TsUk0zQiN4uPfJpB9m+rPMQ==", + "version": "9.39.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.1.tgz", + "integrity": "sha512-BhHmn2yNOFA9H9JmmIVKJmd288g9hrVRDkdoIgRCRuSySRUHH7r/DI6aAXW9T1WwUuY3DFgrcaqB+deURBLR5g==", "dev": true, "license": "MIT", "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", - "@eslint/config-array": "^0.21.0", - "@eslint/config-helpers": "^0.3.1", - "@eslint/core": "^0.15.2", + "@eslint/config-array": "^0.21.1", + "@eslint/config-helpers": "^0.4.2", + "@eslint/core": "^0.17.0", "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "9.36.0", - "@eslint/plugin-kit": "^0.3.5", + "@eslint/js": "9.39.1", + "@eslint/plugin-kit": "^0.4.1", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.4.2", "@types/estree": "^1.0.6", - "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.6", @@ -614,22 +614,6 @@ } } }, - "node_modules/eslint-config-prettier": { - "version": "10.1.8", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.1.8.tgz", - "integrity": "sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==", - "dev": true, - "license": "MIT", - "bin": { - "eslint-config-prettier": "bin/cli.js" - }, - "funding": { - "url": "https://opencollective.com/eslint-config-prettier" - }, - "peerDependencies": { - "eslint": ">=7.0.0" - } - }, "node_modules/eslint-config-treesitter": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/eslint-config-treesitter/-/eslint-config-treesitter-1.0.2.tgz", @@ -973,9 +957,9 @@ "license": "ISC" }, "node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", + "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", "dev": true, "license": "MIT", "dependencies": { @@ -1108,9 +1092,9 @@ "license": "MIT" }, "node_modules/node-abi": { - "version": "3.77.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.77.0.tgz", - "integrity": "sha512-DSmt0OEcLoK4i3NuscSbGjOf3bqiDEutejqENSplMSFA/gmB8mkED9G4pKWnPl7MDU4rSHebKPHeitpDfyH0cQ==", + "version": "3.85.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.85.0.tgz", + "integrity": "sha512-zsFhmbkAzwhTft6nd3VxcG0cvJsT70rL+BIGHWVq5fi6MwGrHwzqKaxXE+Hl2GmnGItnDKPPkO5/LQqjVkIdFg==", "dev": true, "license": "MIT", "dependencies": { @@ -1291,22 +1275,6 @@ "node": ">= 0.8.0" } }, - "node_modules/prettier": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.6.2.tgz", - "integrity": "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==", - "dev": true, - "license": "MIT", - "bin": { - "prettier": "bin/prettier.cjs" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" - } - }, "node_modules/pump": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.3.tgz", @@ -1375,9 +1343,9 @@ "license": "MIT" }, "node_modules/semver": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", - "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", "dev": true, "license": "ISC", "bin": { diff --git a/package.json b/package.json index 8d7f2549..f0877341 100644 --- a/package.json +++ b/package.json @@ -30,11 +30,9 @@ "node-gyp-build": "^4.8.4" }, "devDependencies": { - "eslint": "^9.36.0", - "eslint-config-prettier": "^10.1.8", + "eslint": "^9.39.1", "eslint-config-treesitter": "^1.0.2", "prebuildify": "^6.0.1", - "prettier": "^3.6.2", "tree-sitter-cli": "^0.25.9" }, "peerDependencies": { @@ -51,6 +49,6 @@ "start": "tree-sitter playground", "test": "node --test bindings/node/*_test.js", "lint": "eslint grammar.js", - "format": "prettier --check ." + "format": "eslint --fix grammar.js" } }