flatlint 1.106.0 → 1.107.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,13 @@
1
+ 2025.02.10, v1.107.0
2
+
3
+ feature:
4
+ - 14e276d flatlint: convert-comma-to-semicolon: last
5
+
6
+ 2025.02.10, v1.106.1
7
+
8
+ fix:
9
+ - b5f2743 flatlint: add-missing-comma: import
10
+
1
11
  2025.02.10, v1.106.0
2
12
 
3
13
  feature:
@@ -21,6 +21,9 @@ export const match = () => ({
21
21
  if (path.isNextKeyword())
22
22
  return false;
23
23
 
24
+ if (!path.isNext())
25
+ return false;
26
+
24
27
  if (path.isInsideTemplate())
25
28
  return false;
26
29
 
@@ -54,6 +54,9 @@ export const match = () => ({
54
54
 
55
55
  return path.isNextKeyword();
56
56
  },
57
+ '__a,': (vars, path) => {
58
+ return !path.isNext();
59
+ },
57
60
  });
58
61
 
59
62
  export const replace = () => ({
@@ -63,6 +66,7 @@ export const replace = () => ({
63
66
  'return __expr,': 'return __expr;',
64
67
  '__a.__b = __expr,': '__a.__b = __expr;',
65
68
  '"__a",': '"__a";',
69
+ '__a,': '__a;',
66
70
  });
67
71
 
68
72
  const check = ({__x}, path) => {
@@ -31,6 +31,9 @@ export const isNumericLiteral = ({type}) => type === 'NumericLiteral';
31
31
  export const isNewLine = ({type}) => type === 'LineTerminatorSequence';
32
32
 
33
33
  export const isKeyword = (token, name) => {
34
+ if (!token)
35
+ return false;
36
+
34
37
  const {value} = token;
35
38
  const is = keyword.isKeyword(value);
36
39
  const isTS = keyword.isTSKeyword(value);
@@ -233,4 +236,3 @@ export const getPrev = ({tokens, start}) => {
233
236
  return token;
234
237
  }
235
238
  };
236
-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flatlint",
3
- "version": "1.106.0",
3
+ "version": "1.107.0",
4
4
  "description": "JavaScript tokens-based linter",
5
5
  "main": "lib/flatlint.js",
6
6
  "type": "module",