flatlint 2.11.0 → 2.12.0

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.18, v2.12.0
2
+
3
+ feature:
4
+ - ee6cdc9 flatlint: convert-semicolon-to-comma: exclude call
5
+
1
6
  2025.03.15, v2.11.0
2
7
 
3
8
  feature:
@@ -1,9 +1,13 @@
1
1
  import {
2
2
  closeSquareBrace,
3
3
  colon,
4
+ dot,
4
5
  isKeyword,
5
6
  isOneOfKeywords,
6
7
  isPunctuator,
8
+ semicolon,
9
+ assign,
10
+ bitwiseAnd,
7
11
  } from '#types';
8
12
 
9
13
  const keywords = [
@@ -27,6 +31,9 @@ export const match = () => ({
27
31
  return false;
28
32
 
29
33
  for (const token of path.getAllPrev()) {
34
+ if (isPunctuator(token, semicolon))
35
+ return false;
36
+
30
37
  if (isOneOfKeywords(token, keywords))
31
38
  return false;
32
39
  }
@@ -55,13 +62,16 @@ export const match = () => ({
55
62
  if (path.isNextKeyword())
56
63
  return false;
57
64
 
65
+ const isNextCall = path.isNextCompare('__a.__b(');
66
+
58
67
  for (const token of path.getAllPrev()) {
59
68
  if (isOneOfKeywords(token, keywords))
60
69
  return false;
61
- }
62
-
63
- for (const token of path.getAllPrev()) {
64
- if (isPunctuator(token, colon))
70
+
71
+ if (isPunctuator(token, [assign, bitwiseAnd, dot, semicolon]))
72
+ return false;
73
+
74
+ if (isPunctuator(token, colon) && !isNextCall)
65
75
  return true;
66
76
  }
67
77
 
@@ -78,3 +88,4 @@ export const replace = () => ({
78
88
  ');': '),',
79
89
  '__a];': '__a],',
80
90
  });
91
+
@@ -146,6 +146,7 @@ export const isTemplateArrayToken = (a) => isIdentifier(a) && isTemplateArray(a.
146
146
  export const isTemplateExpressionToken = (a) => isIdentifier(a) && isTemplateExpression(a.value);
147
147
  export const isTemplateArgsToken = (a) => isIdentifier(a) && isTemplateArgs(a.value);
148
148
 
149
+ export const bitwiseAnd = Punctuator('&');
149
150
  export const arrow = Punctuator('=>');
150
151
  export const closeRoundBrace = Punctuator(')');
151
152
  export const closeSquareBrace = Punctuator(']');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flatlint",
3
- "version": "2.11.0",
3
+ "version": "2.12.0",
4
4
  "description": "JavaScript tokens-based linter",
5
5
  "main": "lib/flatlint.js",
6
6
  "type": "module",