flatlint 1.39.1 → 1.39.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,8 @@
1
+ 2025.01.12, v1.39.2
2
+
3
+ fix:
4
+ - f0149a2 flatlint: add-missing-comma: do not add before any punctuator
5
+
1
6
  2025.01.12, v1.39.1
2
7
 
3
8
  feature:
@@ -1,43 +1,19 @@
1
- import {
2
- assign,
3
- closeCurlyBrace,
4
- closeRoundBrace,
5
- colon,
6
- comma,
7
- dot,
8
- isIdentifier,
9
- isOperator,
10
- more,
11
- openRoundBrace,
12
- } from '#types';
1
+ import {isIdentifier, isOperator} from '#types';
13
2
 
14
3
  export const report = () => 'Add missing comma';
15
4
 
16
5
  export const match = () => ({
17
6
  __a: ({__a}, path) => {
18
- const punctuators = [
19
- assign,
20
- comma,
21
- openRoundBrace,
22
- closeRoundBrace,
23
- closeCurlyBrace,
24
- colon,
25
- dot,
26
- more,
27
- ];
28
-
29
7
  if (!isIdentifier(__a))
30
8
  return false;
31
9
 
32
10
  if (isOperator(__a))
33
11
  return false;
34
12
 
35
- return !path.isNextPunctuator(punctuators);
13
+ return !path.isNextPunctuator();
36
14
  },
37
15
  });
38
16
 
39
17
  export const replace = () => ({
40
18
  __a: '__a,',
41
19
  });
42
-
43
-
@@ -121,6 +121,9 @@ const createIsNextPunctuator = ({tokens, end}) => (punctuators) => {
121
121
  if (!current)
122
122
  return false;
123
123
 
124
+ if (!punctuators)
125
+ return isPunctuator(current);
126
+
124
127
  for (const punctuator of maybeArray(punctuators)) {
125
128
  if (isPunctuator(current, punctuator))
126
129
  return true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flatlint",
3
- "version": "1.39.1",
3
+ "version": "1.39.2",
4
4
  "description": "JavaScript tokens-based linter",
5
5
  "main": "lib/flatlint.js",
6
6
  "type": "module",