flatlint 1.93.0 → 1.93.1
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
package/README.md
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
closeCurlyBrace,
|
|
3
|
+
closeSquareBrace,
|
|
3
4
|
colon,
|
|
4
5
|
isIdentifier,
|
|
5
6
|
isPunctuator,
|
|
6
7
|
openSquireBrace,
|
|
8
|
+
semicolon,
|
|
7
9
|
spread,
|
|
8
10
|
} from '#types';
|
|
9
11
|
|
|
@@ -54,6 +56,23 @@ export const match = () => ({
|
|
|
54
56
|
|
|
55
57
|
return true;
|
|
56
58
|
},
|
|
59
|
+
'],': (vars, path) => {
|
|
60
|
+
let result = false;
|
|
61
|
+
|
|
62
|
+
for (const token of path.getAllNext()) {
|
|
63
|
+
if (isPunctuator(token, closeSquareBrace)) {
|
|
64
|
+
result = false;
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (isPunctuator(token, semicolon)) {
|
|
69
|
+
result = true;
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return result;
|
|
75
|
+
},
|
|
57
76
|
});
|
|
58
77
|
|
|
59
78
|
export const replace = () => ({
|
|
@@ -61,4 +80,6 @@ export const replace = () => ({
|
|
|
61
80
|
'__a(__args),': '__a(__args)',
|
|
62
81
|
'},': '}',
|
|
63
82
|
'}),': '})',
|
|
83
|
+
'],': '];',
|
|
64
84
|
});
|
|
85
|
+
|
package/lib/runner/path.js
CHANGED
|
@@ -22,6 +22,10 @@ export const createPath = ({tokens, start, end}) => ({
|
|
|
22
22
|
tokens,
|
|
23
23
|
start,
|
|
24
24
|
}),
|
|
25
|
+
getAllNext: createGetAllNext({
|
|
26
|
+
tokens,
|
|
27
|
+
end,
|
|
28
|
+
}),
|
|
25
29
|
getPrev: createGetPrev({
|
|
26
30
|
tokens,
|
|
27
31
|
start,
|
|
@@ -156,3 +160,10 @@ const createGetAllPrev = ({tokens, start}) => function*() {
|
|
|
156
160
|
yield tokens[i];
|
|
157
161
|
}
|
|
158
162
|
};
|
|
163
|
+
|
|
164
|
+
const createGetAllNext = ({tokens, end}) => function*() {
|
|
165
|
+
for (let i = end; i < tokens.length; ++i)
|
|
166
|
+
yield tokens[i];
|
|
167
|
+
/* c8 ignore start */
|
|
168
|
+
/* c8 ignore end */
|
|
169
|
+
};
|