flatlint 4.0.1 → 4.0.3
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
|
@@ -63,7 +63,8 @@ export const match = () => ({
|
|
|
63
63
|
if (path.isNextKeyword())
|
|
64
64
|
return false;
|
|
65
65
|
|
|
66
|
-
const isNextCall = path.
|
|
66
|
+
const isNextCall = path.isNextCompareAll(['__a(', '__a.__b(']);
|
|
67
|
+
|
|
67
68
|
const isNextClose = path.isNextCompare('},}');
|
|
68
69
|
|
|
69
70
|
for (const token of path.getAllPrev()) {
|
|
@@ -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'))
|
package/lib/runner/path.js
CHANGED
|
@@ -51,6 +51,10 @@ export const createPath = ({tokens, start, end}) => ({
|
|
|
51
51
|
tokens,
|
|
52
52
|
end,
|
|
53
53
|
}),
|
|
54
|
+
isNextCompareAll: createIsNextCompareAll({
|
|
55
|
+
tokens,
|
|
56
|
+
end,
|
|
57
|
+
}),
|
|
54
58
|
isNextDeclarationKeyword: createIsNextDeclarationKeyword({
|
|
55
59
|
tokens,
|
|
56
60
|
end,
|
|
@@ -233,6 +237,20 @@ const createGetAllNext = ({tokens, end}) => function*() {
|
|
|
233
237
|
}
|
|
234
238
|
};
|
|
235
239
|
|
|
240
|
+
const createIsNextCompareAll = ({tokens, end}) => (templates) => {
|
|
241
|
+
const isNextCompare = createIsNextCompare({
|
|
242
|
+
tokens,
|
|
243
|
+
end,
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
for (const template of templates) {
|
|
247
|
+
if (isNextCompare(template))
|
|
248
|
+
return true;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
return false;
|
|
252
|
+
};
|
|
253
|
+
|
|
236
254
|
const createIsNextCompare = ({tokens, end}) => (template) => {
|
|
237
255
|
const getAllNext = createGetAllNext({
|
|
238
256
|
tokens,
|