flatlint 2.1.0 → 2.1.2

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.02.28, v2.1.2
2
+
3
+ fix:
4
+ - b670c83 flatlint: collect-args: infinite loop
5
+
6
+ 2025.02.28, v2.1.1
7
+
8
+ fix:
9
+ - 56b5b01 flatlint: convert-semicolon-to-comma: close curly brace
10
+
1
11
  2025.02.28, v2.1.0
2
12
 
3
13
  feature:
@@ -62,7 +62,7 @@ export const collectArgs = ({currentTokenIndex, tokens}) => {
62
62
  break;
63
63
  }
64
64
 
65
- if (isNewLine(tokens[index - 1]))
65
+ if (isNewLine(tokens[index - 1]) && index !== n)
66
66
  --index;
67
67
 
68
68
  return [
@@ -1,4 +1,5 @@
1
1
  import {
2
+ closeCurlyBrace,
2
3
  closeSquareBrace,
3
4
  colon,
4
5
  isOneOfKeywords,
@@ -46,6 +47,9 @@ export const match = () => ({
46
47
  if (!path.isNext())
47
48
  return false;
48
49
 
50
+ if (path.isPrevPunctuator(closeCurlyBrace))
51
+ return false;
52
+
49
53
  for (const token of path.getAllPrev()) {
50
54
  if (isOneOfKeywords(token, keywords))
51
55
  return false;
@@ -65,4 +69,3 @@ export const replace = () => ({
65
69
  '__a;': '__a,',
66
70
  ');': '),',
67
71
  });
68
-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flatlint",
3
- "version": "2.1.0",
3
+ "version": "2.1.2",
4
4
  "description": "JavaScript tokens-based linter",
5
5
  "main": "lib/flatlint.js",
6
6
  "type": "module",