flatlint 2.1.5 → 2.1.6
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
|
@@ -9,6 +9,8 @@ import {
|
|
|
9
9
|
isOnlyWhitespaces,
|
|
10
10
|
isKeyword,
|
|
11
11
|
openRoundBrace,
|
|
12
|
+
isPunctuator,
|
|
13
|
+
colon,
|
|
12
14
|
} from '#types';
|
|
13
15
|
|
|
14
16
|
export const report = () => 'Add missing semicolon';
|
|
@@ -42,6 +44,9 @@ export const match = () => ({
|
|
|
42
44
|
for (const current of path.getAllPrev()) {
|
|
43
45
|
if (isKeyword(current, 'if'))
|
|
44
46
|
return false;
|
|
47
|
+
|
|
48
|
+
if (isPunctuator(current, colon))
|
|
49
|
+
return false;
|
|
45
50
|
}
|
|
46
51
|
|
|
47
52
|
return !path.isPrevIdentifier('function');
|
|
@@ -59,6 +64,14 @@ export const match = () => ({
|
|
|
59
64
|
if (path.isNextPunctuator(punctuators))
|
|
60
65
|
return false;
|
|
61
66
|
|
|
67
|
+
for (const current of path.getAllPrev()) {
|
|
68
|
+
if (isPunctuator(current, colon))
|
|
69
|
+
return false;
|
|
70
|
+
|
|
71
|
+
if (isKeyword(current, 'const'))
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
|
|
62
75
|
return !path.isNextPunctuator([semicolon, openCurlyBrace]);
|
|
63
76
|
},
|
|
64
77
|
});
|
|
@@ -66,6 +79,5 @@ export const match = () => ({
|
|
|
66
79
|
export const replace = () => ({
|
|
67
80
|
'const __a = __expr': 'const __a = __expr;',
|
|
68
81
|
'__a(__args)': '__a(__args);',
|
|
69
|
-
|
|
70
82
|
'})': '});',
|
|
71
83
|
});
|