flatlint 2.3.2 → 2.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/ChangeLog CHANGED
@@ -1,3 +1,13 @@
1
+ 2025.03.07, v2.3.4
2
+
3
+ fix:
4
+ - 429e4ba flatlint: add-missing-round-brace: false positive
5
+
6
+ 2025.03.07, v2.3.3
7
+
8
+ fix:
9
+ - 307c3ef add-missing-round-brace: false positive on function declaration
10
+
1
11
  2025.03.07, v2.3.2
2
12
 
3
13
  fix:
@@ -61,14 +61,28 @@ export const match = () => ({
61
61
  return false;
62
62
  },
63
63
  '}': (vars, path) => {
64
+ if (!path.isNext())
65
+ return false;
66
+
64
67
  if (path.isNextKeyword())
65
68
  return false;
66
69
 
70
+ let balance = 0;
71
+
67
72
  for (const token of path.getAllPrev()) {
73
+ if (isPunctuator(token, openRoundBrace))
74
+ ++balance;
75
+
76
+ if (isPunctuator(token, closeRoundBrace))
77
+ --balance;
78
+
68
79
  if (isKeyword(token, 'if'))
69
80
  return false;
70
81
  }
71
82
 
83
+ if (!balance)
84
+ return false;
85
+
72
86
  return path.isNextCompare('__a(');
73
87
  },
74
88
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flatlint",
3
- "version": "2.3.2",
3
+ "version": "2.3.4",
4
4
  "description": "JavaScript tokens-based linter",
5
5
  "main": "lib/flatlint.js",
6
6
  "type": "module",