flatlint 2.0.0 → 2.0.1

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.02.17, v2.0.1
2
+
3
+ fix:
4
+ - 544a124 flatlint: add-missing-round-brace: exclude const
5
+
1
6
  2025.02.17, v2.0.0
2
7
 
3
8
  feature:
@@ -1,6 +1,8 @@
1
1
  import {
2
2
  closeRoundBrace,
3
+ closeSquareBrace,
3
4
  colon,
5
+ comma,
4
6
  isKeyword,
5
7
  isPunctuator,
6
8
  openRoundBrace,
@@ -48,7 +50,18 @@ export const match = () => ({
48
50
  return balance;
49
51
  },
50
52
  '"__a"': (vars, path) => {
51
- return path.isNextKeyword();
53
+ for (const current of path.getAllPrev()) {
54
+ if (path.isNextPunctuator([comma, closeRoundBrace, closeSquareBrace]))
55
+ return false;
56
+
57
+ if (isPunctuator(current, closeRoundBrace))
58
+ return false;
59
+
60
+ if (isPunctuator(current, openRoundBrace))
61
+ return true;
62
+ }
63
+
64
+ return false;
52
65
  },
53
66
  });
54
67
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flatlint",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "JavaScript tokens-based linter",
5
5
  "main": "lib/flatlint.js",
6
6
  "type": "module",