flatlint 2.0.3 → 2.0.4
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 +5 -0
- package/README.md +0 -1
- package/lib/parser/parser.js +0 -1
- package/lib/plugins/add-missing-comma/index.js +3 -0
- package/lib/plugins/add-missing-round-brace/index.js +1 -3
- package/lib/plugins/convert-colon-to-semicolon/index.js +0 -1
- package/lib/plugins/convert-semicolon-to-comma/index.js +9 -3
- package/package.json +1 -1
package/ChangeLog
CHANGED
package/README.md
CHANGED
package/lib/parser/parser.js
CHANGED
|
@@ -6,13 +6,12 @@ import {
|
|
|
6
6
|
isKeyword,
|
|
7
7
|
isPunctuator,
|
|
8
8
|
openRoundBrace,
|
|
9
|
-
semicolon,
|
|
10
9
|
} from '#types';
|
|
11
10
|
|
|
12
11
|
export const report = () => 'Add missing round brace';
|
|
13
12
|
|
|
14
13
|
export const match = () => ({
|
|
15
|
-
'__a(__args': (
|
|
14
|
+
'__a(__args': (vars, path) => {
|
|
16
15
|
if (path.isCurrentPunctuator(closeRoundBrace))
|
|
17
16
|
return false;
|
|
18
17
|
|
|
@@ -74,4 +73,3 @@ export const replace = () => ({
|
|
|
74
73
|
'{__a} = __expr': '({__a} = __expr)',
|
|
75
74
|
'__a;': '__a);',
|
|
76
75
|
});
|
|
77
|
-
|
|
@@ -27,10 +27,16 @@ export const match = () => ({
|
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
'__a: __expr;': (vars, path) => {
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
const keywords = [
|
|
31
|
+
'class',
|
|
32
|
+
'readonly',
|
|
33
|
+
'static',
|
|
34
|
+
'implements',
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
for (const token of path.getAllPrev())
|
|
38
|
+
if (isOneOfKeywords(token, keywords))
|
|
32
39
|
return false;
|
|
33
|
-
}
|
|
34
40
|
|
|
35
41
|
return true;
|
|
36
42
|
},
|