Skip to content

Commit 6c40ed4

Browse files
authored
chore(eslint): run on all files + fix issues (#61)
1 parent bf3b3ae commit 6c40ed4

File tree

5 files changed

+33
-22
lines changed

5 files changed

+33
-22
lines changed

bindings/node/binding_test.js

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindings/node/index.js

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eslint.config.mjs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1-
import treesitter from "eslint-config-treesitter";
1+
import treesitter from 'eslint-config-treesitter';
22

3-
export default [...treesitter];
3+
export default [
4+
...treesitter,
5+
{
6+
rules: {
7+
'no-unused-vars': ['error', {
8+
argsIgnorePattern: '^_',
9+
caughtErrorsIgnorePattern: '^_',
10+
varsIgnorePattern: '^_',
11+
}],
12+
},
13+
},
14+
];

grammar.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module.exports = grammar({
99
macro_tag: ($) =>
1010
seq(token.immediate('{{'), $.ident, optional($.args), '}}'),
1111

12-
text: ($) =>
12+
text: (_$) =>
1313
token(
1414
repeat1(
1515
choice(
@@ -49,22 +49,22 @@ module.exports = grammar({
4949
$.boolean,
5050
),
5151

52-
boolean: ($) => choice('true', 'false'),
53-
none: ($) => prec(1, ','),
52+
boolean: (_$) => choice('true', 'false'),
53+
none: (_$) => prec(1, ','),
5454

5555
// ---------------------------------------------------------------------------
5656
// Identifiers
5757
// ---------------------------------------------------------------------------
5858

59-
ident: ($) => /[a-zA-Z_][a-zA-Z0-9_\-]*/,
59+
ident: (_$) => /[a-zA-Z_][a-zA-Z0-9_\-]*/,
6060

6161
// ---------------------------------------------------------------------------
6262
// Numbers
6363
// ---------------------------------------------------------------------------
6464

65-
int: ($) => token(choice(/-?0/, /-?[1-9]\d*/)),
65+
int: (_$) => token(choice(/-?0/, /-?[1-9]\d*/)),
6666

67-
float: ($) => token(choice(/-?0\.\d+/, /-?[1-9]\d*\.\d+/)),
67+
float: (_$) => token(choice(/-?0\.\d+/, /-?[1-9]\d*\.\d+/)),
6868

6969
// ---------------------------------------------------------------------------
7070
// Strings
@@ -95,7 +95,7 @@ module.exports = grammar({
9595
//
9696
// In Tree-sitter, it’s typical to make these immediate tokens
9797
// so that once we've started a string, we parse char-by-char.
98-
_dq_char: ($) =>
98+
_dq_char: (_$) =>
9999
token.immediate(
100100
choice(
101101
/[^"\\\n]/,
@@ -105,7 +105,7 @@ module.exports = grammar({
105105
),
106106

107107
// sq_char analogous
108-
_sq_char: ($) =>
108+
_sq_char: (_$) =>
109109
token.immediate(
110110
choice(
111111
/[^'\\\n]/,
@@ -115,7 +115,7 @@ module.exports = grammar({
115115
),
116116

117117
// bq_char analogous
118-
_bq_char: ($) =>
118+
_bq_char: (_$) =>
119119
token.immediate(
120120
choice(
121121
/[^`\\\n]/,

package.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)