flatlint 1.108.0 → 1.110.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.11, v1.110.0
2
+
3
+ fix:
4
+ - a2d6d4b flatlint: convert-semicolon-to-comma: before if
5
+
6
+ 2025.02.11, v1.109.0
7
+
8
+ fix:
9
+ - 77a37f9 flatlint: convert-comma-to-semicolon: ], -> ];
10
+
1
11
  2025.02.11, v1.108.0
2
12
 
3
13
  feature:
@@ -10,6 +10,7 @@ import {
10
10
  openRoundBrace,
11
11
  openSquireBrace,
12
12
  quote,
13
+ semicolon,
13
14
  spread,
14
15
  } from '#types';
15
16
 
@@ -58,6 +59,28 @@ export const match = () => ({
58
59
  return path.isPrevKeyword();
59
60
  },
60
61
  '__a,': (vars, path) => !path.isNext(),
62
+ '],': (vars, path) => {
63
+ for (const token of path.getAllPrev()) {
64
+ if (isPunctuator(token, colon))
65
+ return false;
66
+ }
67
+
68
+ let result = false;
69
+
70
+ for (const token of path.getAllNext()) {
71
+ if (isPunctuator(token, closeSquareBrace)) {
72
+ result = false;
73
+ break;
74
+ }
75
+
76
+ if (isPunctuator(token, semicolon)) {
77
+ result = true;
78
+ break;
79
+ }
80
+ }
81
+
82
+ return result;
83
+ },
61
84
  });
62
85
 
63
86
  export const replace = () => ({
@@ -68,6 +91,7 @@ export const replace = () => ({
68
91
  '__a.__b = __expr,': '__a.__b = __expr;',
69
92
  '"__a",': '"__a";',
70
93
  '__a,': '__a;',
94
+ '],': '];',
71
95
  });
72
96
 
73
97
  const check = ({__x}, path) => {
@@ -8,6 +8,9 @@ export const report = () => `Use ',' instead of ';'`;
8
8
 
9
9
  export const match = () => ({
10
10
  '__a;': (vars, path) => {
11
+ if (path.isNextKeyword())
12
+ return false;
13
+
11
14
  for (const token of path.getAllPrev()) {
12
15
  if (isOneOfKeywords(token, [
13
16
  'readonly',
@@ -56,28 +56,6 @@ export const match = () => ({
56
56
 
57
57
  return true;
58
58
  },
59
- '],': (vars, path) => {
60
- for (const token of path.getAllPrev()) {
61
- if (isPunctuator(token, colon))
62
- return false;
63
- }
64
-
65
- let result = false;
66
-
67
- for (const token of path.getAllNext()) {
68
- if (isPunctuator(token, closeSquareBrace)) {
69
- result = false;
70
- break;
71
- }
72
-
73
- if (isPunctuator(token, semicolon)) {
74
- result = true;
75
- break;
76
- }
77
- }
78
-
79
- return result;
80
- },
81
59
  });
82
60
 
83
61
  export const replace = () => ({
@@ -85,5 +63,4 @@ export const replace = () => ({
85
63
  '__a(__args),': '__a(__args)',
86
64
  '},': '}',
87
65
  '}),': '})',
88
- '],': '];',
89
66
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flatlint",
3
- "version": "1.108.0",
3
+ "version": "1.110.0",
4
4
  "description": "JavaScript tokens-based linter",
5
5
  "main": "lib/flatlint.js",
6
6
  "type": "module",