flatlint 2.3.3 → 2.3.5

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.5
2
+
3
+ feature:
4
+ - ddfb7d9 convert-semicolon-to-comma: exclude throw
5
+
6
+ 2025.03.07, v2.3.4
7
+
8
+ fix:
9
+ - 429e4ba flatlint: add-missing-round-brace: false positive
10
+
1
11
  2025.03.07, v2.3.3
2
12
 
3
13
  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
  });
@@ -12,6 +12,7 @@ const keywords = [
12
12
  'interface',
13
13
  'class',
14
14
  'return',
15
+ 'throw',
15
16
  ];
16
17
 
17
18
  export const report = () => `Use ',' instead of ';'`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flatlint",
3
- "version": "2.3.3",
3
+ "version": "2.3.5",
4
4
  "description": "JavaScript tokens-based linter",
5
5
  "main": "lib/flatlint.js",
6
6
  "type": "module",