flatlint 2.3.3 → 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,8 @@
1
+ 2025.03.07, v2.3.4
2
+
3
+ fix:
4
+ - 429e4ba flatlint: add-missing-round-brace: false positive
5
+
1
6
  2025.03.07, v2.3.3
2
7
 
3
8
  fix:
@@ -67,11 +67,22 @@ export const match = () => ({
67
67
  if (path.isNextKeyword())
68
68
  return false;
69
69
 
70
+ let balance = 0;
71
+
70
72
  for (const token of path.getAllPrev()) {
73
+ if (isPunctuator(token, openRoundBrace))
74
+ ++balance;
75
+
76
+ if (isPunctuator(token, closeRoundBrace))
77
+ --balance;
78
+
71
79
  if (isKeyword(token, 'if'))
72
80
  return false;
73
81
  }
74
82
 
83
+ if (!balance)
84
+ return false;
85
+
75
86
  return path.isNextCompare('__a(');
76
87
  },
77
88
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flatlint",
3
- "version": "2.3.3",
3
+ "version": "2.3.4",
4
4
  "description": "JavaScript tokens-based linter",
5
5
  "main": "lib/flatlint.js",
6
6
  "type": "module",