flatlint 1.69.0 → 1.71.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 +10 -0
- package/README.md +1 -1
- package/lib/plugins/add-missing-assign/index.js +8 -1
- package/lib/types/types.js +1 -0
- package/package.json +1 -1
package/ChangeLog
CHANGED
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@ import {
|
|
|
2
2
|
assign,
|
|
3
3
|
isOneOfKeywords,
|
|
4
4
|
isOneOfPunctuators,
|
|
5
|
+
openCurlyBrace,
|
|
6
|
+
semicolon,
|
|
5
7
|
} from '#types';
|
|
6
8
|
|
|
7
9
|
export const report = () => 'Add missing assign';
|
|
@@ -16,7 +18,12 @@ export const match = () => ({
|
|
|
16
18
|
|
|
17
19
|
return !isOneOfPunctuators(assign, __expr);
|
|
18
20
|
},
|
|
19
|
-
'__a.__b __expr': ({__expr}) =>
|
|
21
|
+
'__a.__b __expr': ({__expr}, path) => {
|
|
22
|
+
if (path.isNextPunctuator() && !path.isNextPunctuator(semicolon))
|
|
23
|
+
return false;
|
|
24
|
+
|
|
25
|
+
return !isOneOfPunctuators(assign, __expr);
|
|
26
|
+
},
|
|
20
27
|
});
|
|
21
28
|
|
|
22
29
|
export const replace = () => ({
|
package/lib/types/types.js
CHANGED