flatlint 1.47.0 → 1.47.1
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
package/README.md
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
closeRoundBrace,
|
|
3
3
|
isPunctuator,
|
|
4
|
+
openRoundBrace,
|
|
4
5
|
} from '#types';
|
|
5
6
|
|
|
6
|
-
export const report = () => 'Add missing round
|
|
7
|
+
export const report = () => 'Add missing round brace';
|
|
7
8
|
|
|
8
9
|
export const match = () => ({
|
|
10
|
+
'(__args) {': ({__args}) => {
|
|
11
|
+
if (!isPunctuator(openRoundBrace, __args))
|
|
12
|
+
return false;
|
|
13
|
+
|
|
14
|
+
return !isPunctuator(closeRoundBrace, __args);
|
|
15
|
+
},
|
|
9
16
|
'__a(__args': (vars, path) => {
|
|
10
17
|
if (path.isCurrentPunctuator(closeRoundBrace))
|
|
11
18
|
return false;
|
|
@@ -22,4 +29,5 @@ export const match = () => ({
|
|
|
22
29
|
export const replace = () => ({
|
|
23
30
|
'if __a > __b': 'if (__a > __b)',
|
|
24
31
|
'__a(__args': '__a(__args)',
|
|
32
|
+
'(__args) {': '(__args)) {',
|
|
25
33
|
});
|
package/lib/plugins.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as addMissingArrow from './plugins/add-missing-arrow/index.js';
|
|
2
|
-
import * as
|
|
2
|
+
import * as addMissingRoundBrace from './plugins/add-missing-round-brace/index.js';
|
|
3
3
|
import * as addMissingSquireBrace from './plugins/add-missing-square-brace/index.js';
|
|
4
4
|
import * as addMissingQuote from './plugins/add-missing-quote/index.js';
|
|
5
5
|
import * as addMissingSemicolon from './plugins/add-missing-semicolon/index.js';
|
|
@@ -14,7 +14,7 @@ import * as wrapAssignmentInParens from './plugins/wrap-assignment-in-parens/ind
|
|
|
14
14
|
|
|
15
15
|
export const plugins = [
|
|
16
16
|
['add-missing-arrow', addMissingArrow],
|
|
17
|
-
['add-missing-round-
|
|
17
|
+
['add-missing-round-brace', addMissingRoundBrace],
|
|
18
18
|
['add-missing-squire-brace', addMissingSquireBrace],
|
|
19
19
|
['add-missing-semicolon', addMissingSemicolon],
|
|
20
20
|
['add-missing-comma', addMissingComma],
|