flatlint 2.0.2 → 2.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
|
@@ -13,11 +13,6 @@ export const report = () => 'Add missing round brace';
|
|
|
13
13
|
|
|
14
14
|
export const match = () => ({
|
|
15
15
|
'__a(__args': ({__args}, path) => {
|
|
16
|
-
const last = __args.at(-1);
|
|
17
|
-
|
|
18
|
-
if (isPunctuator(last, semicolon))
|
|
19
|
-
return false;
|
|
20
|
-
|
|
21
16
|
if (path.isCurrentPunctuator(closeRoundBrace))
|
|
22
17
|
return false;
|
|
23
18
|
|
|
@@ -34,23 +29,23 @@ export const match = () => ({
|
|
|
34
29
|
if (path.isPrevPunctuator(colon))
|
|
35
30
|
return false;
|
|
36
31
|
|
|
37
|
-
let
|
|
32
|
+
let result = true;
|
|
38
33
|
|
|
39
|
-
for (const current of path.getAllPrev())
|
|
40
|
-
if (
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
--balance;
|
|
45
|
-
|
|
46
|
-
if (isKeyword(current))
|
|
47
|
-
return false;
|
|
48
|
-
}
|
|
34
|
+
for (const current of path.getAllPrev())
|
|
35
|
+
if (isKeyword(current)) {
|
|
36
|
+
result = false;
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
49
39
|
|
|
50
|
-
return
|
|
40
|
+
return result;
|
|
51
41
|
},
|
|
52
42
|
'"__a"': (vars, path) => {
|
|
53
|
-
if (path.isNextPunctuator([
|
|
43
|
+
if (path.isNextPunctuator([
|
|
44
|
+
colon,
|
|
45
|
+
comma,
|
|
46
|
+
closeRoundBrace,
|
|
47
|
+
closeSquareBrace,
|
|
48
|
+
]))
|
|
54
49
|
return false;
|
|
55
50
|
|
|
56
51
|
if (path.isPrevPunctuator(colon))
|
|
@@ -79,3 +74,4 @@ export const replace = () => ({
|
|
|
79
74
|
'{__a} = __expr': '({__a} = __expr)',
|
|
80
75
|
'__a;': '__a);',
|
|
81
76
|
});
|
|
77
|
+
|