flatlint 4.0.2 → 4.0.4

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.4
2
+
3
+ feature:
4
+ - f062bd2 flatlint: convert-semicolon-to-comma: improve support
5
+
6
+ 2026.01.01, v4.0.3
7
+
8
+ fix:
9
+ - 2d02de1 flatlint: remove-useless-comma: false positive
10
+
1
11
  2026.01.01, v4.0.2
2
12
 
3
13
  fix:
@@ -1,4 +1,5 @@
1
1
  import {
2
+ quote,
2
3
  closeSquareBrace,
3
4
  colon,
4
5
  dot,
@@ -63,10 +64,8 @@ export const match = () => ({
63
64
  if (path.isNextKeyword())
64
65
  return false;
65
66
 
66
- const isNextCall = path.isNextCompareAll([
67
- '__a(',
68
- '__a.__b(',
69
- ]);
67
+ const isNextCall = path.isNextCompareAll(['__a(', '__a.__b(']);
68
+
70
69
  const isNextClose = path.isNextCompare('},}');
71
70
 
72
71
  for (const token of path.getAllPrev()) {
@@ -91,9 +90,12 @@ export const match = () => ({
91
90
  '__a];': (vars, path) => {
92
91
  return path.isNextPunctuator(closeSquareBrace);
93
92
  },
94
- '=> __a.__b(__c, __d);'(vars, path) {
93
+ '=> __a.__b(__c, __d);': (vars, path) => {
95
94
  return path.isNextPunctuator(closeCurlyBrace);
96
95
  },
96
+ '";': (vars, path) => {
97
+ return path.isNextPunctuator(quote);
98
+ },
97
99
  });
98
100
 
99
101
  export const replace = () => ({
@@ -102,4 +104,5 @@ export const replace = () => ({
102
104
  ');': '),',
103
105
  '__a];': '__a],',
104
106
  '=> __a.__b(__c, __d);': '=> __a.__b(__c, __d),',
107
+ '";': '",',
105
108
  });
@@ -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'))
@@ -238,7 +238,10 @@ const createGetAllNext = ({tokens, end}) => function*() {
238
238
  };
239
239
 
240
240
  const createIsNextCompareAll = ({tokens, end}) => (templates) => {
241
- const isNextCompare = createIsNextCompare({tokens, end});
241
+ const isNextCompare = createIsNextCompare({
242
+ tokens,
243
+ end,
244
+ });
242
245
 
243
246
  for (const template of templates) {
244
247
  if (isNextCompare(template))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flatlint",
3
- "version": "4.0.2",
3
+ "version": "4.0.4",
4
4
  "description": "JavaScript tokens-based linter",
5
5
  "main": "lib/flatlint.js",
6
6
  "type": "module",