flatlint 1.53.0 → 1.54.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 +5 -0
- package/README.md +10 -1
- package/lib/plugins/add-missing-assign/index.js +13 -0
- package/lib/plugins.js +2 -0
- package/package.json +1 -1
package/ChangeLog
CHANGED
package/README.md
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {isOneOfKeywords} from '#types';
|
|
2
|
+
|
|
3
|
+
export const report = () => 'Add missing assign';
|
|
4
|
+
|
|
5
|
+
export const match = () => ({
|
|
6
|
+
'__x __a __b': ({__x}) => {
|
|
7
|
+
return isOneOfKeywords(__x, ['const', 'let', 'var']);
|
|
8
|
+
},
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export const replace = () => ({
|
|
12
|
+
'__x __a __b': '__x __a = __b',
|
|
13
|
+
});
|
package/lib/plugins.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as addMissingArrow from './plugins/add-missing-arrow/index.js';
|
|
2
|
+
import * as addMissingAssign from './plugins/add-missing-assign/index.js';
|
|
2
3
|
import * as addMissingRoundBrace from './plugins/add-missing-round-brace/index.js';
|
|
3
4
|
import * as addMissingSquireBrace from './plugins/add-missing-square-brace/index.js';
|
|
4
5
|
import * as addMissingQuote from './plugins/add-missing-quote/index.js';
|
|
@@ -14,6 +15,7 @@ import * as wrapAssignmentInParens from './plugins/wrap-assignment-in-parens/ind
|
|
|
14
15
|
|
|
15
16
|
export const plugins = [
|
|
16
17
|
['add-missing-arrow', addMissingArrow],
|
|
18
|
+
['add-missing-assign', addMissingAssign],
|
|
17
19
|
['add-missing-round-brace', addMissingRoundBrace],
|
|
18
20
|
['add-missing-squire-brace', addMissingSquireBrace],
|
|
19
21
|
['add-missing-semicolon', addMissingSemicolon],
|