flatlint 5.2.1 → 5.2.2
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
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
closeRoundBrace,
|
|
4
4
|
closeSquareBrace,
|
|
5
5
|
colon,
|
|
6
|
+
isBalancedRoundBraces,
|
|
6
7
|
isOneOfIdentifiers,
|
|
7
8
|
isPunctuator,
|
|
8
9
|
openCurlyBrace,
|
|
@@ -31,7 +32,19 @@ export const match = () => ({
|
|
|
31
32
|
|
|
32
33
|
return path.isNextKeyword();
|
|
33
34
|
},
|
|
34
|
-
'__x __a = __expr,':
|
|
35
|
+
'__x __a = __expr,': ({__expr}, path) => {
|
|
36
|
+
if (!isBalancedRoundBraces(__expr))
|
|
37
|
+
return false;
|
|
38
|
+
|
|
39
|
+
if (!path.isNext())
|
|
40
|
+
return true;
|
|
41
|
+
|
|
42
|
+
if (path.isNextIdentifier('module'))
|
|
43
|
+
return true;
|
|
44
|
+
|
|
45
|
+
if (path.isNextKeyword() && !path.isNextIdentifier('new'))
|
|
46
|
+
return true;
|
|
47
|
+
},
|
|
35
48
|
'__x __a,': check,
|
|
36
49
|
'return __expr,': ({__expr}, path) => {
|
|
37
50
|
if (isPunctuator(openRoundBrace, __expr) && !isPunctuator(closeRoundBrace, __expr))
|
|
@@ -105,11 +118,5 @@ const check = ({__x}, path) => {
|
|
|
105
118
|
if (!isOneOfIdentifiers(__x, ['var', 'let', 'const']))
|
|
106
119
|
return false;
|
|
107
120
|
|
|
108
|
-
if (!path.isNext())
|
|
109
|
-
return true;
|
|
110
|
-
|
|
111
|
-
if (path.isNextIdentifier('module'))
|
|
112
|
-
return true;
|
|
113
|
-
|
|
114
121
|
return path.isNextKeyword() && !path.isNextIdentifier('new');
|
|
115
122
|
};
|