flatlint 2.8.0 → 2.10.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
|
@@ -85,6 +85,7 @@ export const match = () => ({
|
|
|
85
85
|
|
|
86
86
|
return path.isNextCompare('__a(');
|
|
87
87
|
},
|
|
88
|
+
'if (!__a.__b(__args)': (vars, path) => !path.isNextPunctuator(closeRoundBrace),
|
|
88
89
|
});
|
|
89
90
|
|
|
90
91
|
export const replace = () => ({
|
|
@@ -93,6 +94,7 @@ export const replace = () => ({
|
|
|
93
94
|
'if (__a.__b(__args) {': 'if (__a.__b(__args)) {',
|
|
94
95
|
'if (__a(__args) {': 'if (__a(__args)) {',
|
|
95
96
|
'if (__a(__args)': 'if (__a(__args))',
|
|
97
|
+
'if (!__a.__b(__args)': 'if (!__a.__b(__args))',
|
|
96
98
|
'"__a"': '"__a")',
|
|
97
99
|
'{__a} = __expr;': '({__a} = __expr);',
|
|
98
100
|
'{__a} = __expr': '({__a} = __expr)',
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
closeSquareBrace,
|
|
3
3
|
colon,
|
|
4
|
+
isKeyword,
|
|
4
5
|
isOneOfKeywords,
|
|
5
6
|
isPunctuator,
|
|
6
7
|
} from '#types';
|
|
@@ -18,7 +19,10 @@ const keywords = [
|
|
|
18
19
|
export const report = () => `Use ',' instead of ';'`;
|
|
19
20
|
|
|
20
21
|
export const match = () => ({
|
|
21
|
-
'__a;': (
|
|
22
|
+
'__a;': ({__a}, path) => {
|
|
23
|
+
if (isKeyword(__a))
|
|
24
|
+
return false;
|
|
25
|
+
|
|
22
26
|
if (path.isNextKeyword())
|
|
23
27
|
return false;
|
|
24
28
|
|