flatlint 1.88.0 → 1.89.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,6 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
+
assign,
|
|
3
|
+
closeRoundBrace,
|
|
2
4
|
hasRoundBraces,
|
|
3
5
|
isBalancedRoundBraces,
|
|
6
|
+
isPunctuator,
|
|
7
|
+
openRoundBrace,
|
|
4
8
|
} from '#types';
|
|
5
9
|
|
|
6
10
|
export const report = () => 'Remove useless round brace';
|
|
@@ -12,9 +16,23 @@ export const match = () => ({
|
|
|
12
16
|
|
|
13
17
|
return !isBalancedRoundBraces(__expr);
|
|
14
18
|
},
|
|
19
|
+
|
|
20
|
+
'__a);': ({__a}, path) => {
|
|
21
|
+
for (const current of path.getAllPrev()) {
|
|
22
|
+
if (isPunctuator(current, openRoundBrace))
|
|
23
|
+
return false;
|
|
24
|
+
|
|
25
|
+
if (isPunctuator(current, assign))
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return false;
|
|
30
|
+
},
|
|
15
31
|
});
|
|
16
32
|
|
|
17
33
|
export const replace = () => ({
|
|
18
34
|
'const __a = __expr);': 'const __a = __expr;',
|
|
19
35
|
'from "__b")': 'from "__b"',
|
|
36
|
+
'__a);': '__a;',
|
|
20
37
|
});
|
|
38
|
+
|