flatlint 4.0.1 → 4.0.3

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
+ 2026.01.01, v4.0.3
2
+
3
+ fix:
4
+ - 2d02de1 flatlint: remove-useless-comma: false positive
5
+
6
+ 2026.01.01, v4.0.2
7
+
8
+ fix:
9
+ - b3fe87a flatlint: convert-semicolon-to-comma: false positive
10
+
1
11
  2026.01.01, v4.0.1
2
12
 
3
13
  fix:
@@ -63,7 +63,8 @@ export const match = () => ({
63
63
  if (path.isNextKeyword())
64
64
  return false;
65
65
 
66
- const isNextCall = path.isNextCompare('__a.__b(');
66
+ const isNextCall = path.isNextCompareAll(['__a(', '__a.__b(']);
67
+
67
68
  const isNextClose = path.isNextCompare('},}');
68
69
 
69
70
  for (const token of path.getAllPrev()) {
@@ -49,10 +49,7 @@ export const match = () => ({
49
49
  return false;
50
50
 
51
51
  for (const current of path.getAllPrev()) {
52
- if (isPunctuator(current, colon))
53
- return false;
54
-
55
- if (isPunctuator(current, spread))
52
+ if (isPunctuator(current, [openSquireBrace, colon, spread]))
56
53
  return false;
57
54
 
58
55
  if (isKeyword(current, 'if'))
@@ -51,6 +51,10 @@ export const createPath = ({tokens, start, end}) => ({
51
51
  tokens,
52
52
  end,
53
53
  }),
54
+ isNextCompareAll: createIsNextCompareAll({
55
+ tokens,
56
+ end,
57
+ }),
54
58
  isNextDeclarationKeyword: createIsNextDeclarationKeyword({
55
59
  tokens,
56
60
  end,
@@ -233,6 +237,20 @@ const createGetAllNext = ({tokens, end}) => function*() {
233
237
  }
234
238
  };
235
239
 
240
+ const createIsNextCompareAll = ({tokens, end}) => (templates) => {
241
+ const isNextCompare = createIsNextCompare({
242
+ tokens,
243
+ end,
244
+ });
245
+
246
+ for (const template of templates) {
247
+ if (isNextCompare(template))
248
+ return true;
249
+ }
250
+
251
+ return false;
252
+ };
253
+
236
254
  const createIsNextCompare = ({tokens, end}) => (template) => {
237
255
  const getAllNext = createGetAllNext({
238
256
  tokens,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flatlint",
3
- "version": "4.0.1",
3
+ "version": "4.0.3",
4
4
  "description": "JavaScript tokens-based linter",
5
5
  "main": "lib/flatlint.js",
6
6
  "type": "module",