flatlint 1.87.0 → 1.89.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
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
2025.01.30, v1.89.0
|
|
2
|
+
|
|
3
|
+
feature:
|
|
4
|
+
- bda32f8 flatlint: remove-useless-round-brace: improve support of const
|
|
5
|
+
|
|
6
|
+
2025.01.29, v1.88.0
|
|
7
|
+
|
|
8
|
+
feature:
|
|
9
|
+
- da74764 flatlint: convert-comma-to-semicolon: strict mode
|
|
10
|
+
- 3050f21 flatlint: eslint-plugin-putout v24.0.0
|
|
11
|
+
- a3bc440 flatlint: putout v38.0.0
|
|
12
|
+
|
|
1
13
|
2025.01.29, v1.87.0
|
|
2
14
|
|
|
3
15
|
feature:
|
|
@@ -45,6 +45,12 @@ export const match = () => ({
|
|
|
45
45
|
|
|
46
46
|
return !path.isNextPunctuator([quote, openCurlyBrace]);
|
|
47
47
|
},
|
|
48
|
+
'"__a",': (vars, path) => {
|
|
49
|
+
if (path.isNextPunctuator())
|
|
50
|
+
return false;
|
|
51
|
+
|
|
52
|
+
return path.isNextKeyword();
|
|
53
|
+
},
|
|
48
54
|
});
|
|
49
55
|
|
|
50
56
|
export const replace = () => ({
|
|
@@ -54,6 +60,7 @@ export const replace = () => ({
|
|
|
54
60
|
'__a(__args),': '__a(__args);',
|
|
55
61
|
'return __expr,': 'return __expr;',
|
|
56
62
|
'__a.__b = __expr,': '__a.__b = __expr;',
|
|
63
|
+
'"__a",': '"__a";',
|
|
57
64
|
});
|
|
58
65
|
|
|
59
66
|
const check = ({__x}, path) => {
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
+
assign,
|
|
3
|
+
closeRoundBrace,
|
|
2
4
|
hasRoundBraces,
|
|
3
5
|
isBalancedRoundBraces,
|
|
6
|
+
isPunctuator,
|
|
7
|
+
openRoundBrace,
|
|
4
8
|
} from '#types';
|
|
5
9
|
|
|
6
10
|
export const report = () => 'Remove useless round brace';
|
|
@@ -12,9 +16,23 @@ export const match = () => ({
|
|
|
12
16
|
|
|
13
17
|
return !isBalancedRoundBraces(__expr);
|
|
14
18
|
},
|
|
19
|
+
|
|
20
|
+
'__a);': ({__a}, path) => {
|
|
21
|
+
for (const current of path.getAllPrev()) {
|
|
22
|
+
if (isPunctuator(current, openRoundBrace))
|
|
23
|
+
return false;
|
|
24
|
+
|
|
25
|
+
if (isPunctuator(current, assign))
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return false;
|
|
30
|
+
},
|
|
15
31
|
});
|
|
16
32
|
|
|
17
33
|
export const replace = () => ({
|
|
18
34
|
'const __a = __expr);': 'const __a = __expr;',
|
|
19
35
|
'from "__b")': 'from "__b"',
|
|
36
|
+
'__a);': '__a;',
|
|
20
37
|
});
|
|
38
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flatlint",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.89.0",
|
|
4
4
|
"description": "JavaScript tokens-based linter",
|
|
5
5
|
"main": "lib/flatlint.js",
|
|
6
6
|
"type": "module",
|
|
@@ -86,17 +86,17 @@
|
|
|
86
86
|
"js-tokens": "^9.0.1"
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
|
-
"montag": "^1.0.0",
|
|
90
89
|
"@putout/eslint-flat": "^2.0.0",
|
|
91
90
|
"@putout/formatter-json": "^2.0.0",
|
|
92
91
|
"@putout/test": "^11.1.0",
|
|
93
92
|
"c8": "^10.1.2",
|
|
94
93
|
"eslint": "^9.7.0",
|
|
95
|
-
"eslint-plugin-putout": "^
|
|
94
|
+
"eslint-plugin-putout": "^24.0.0",
|
|
96
95
|
"madrun": "^10.2.2",
|
|
97
96
|
"mock-require": "^3.0.3",
|
|
97
|
+
"montag": "^1.0.0",
|
|
98
98
|
"nodemon": "^3.0.1",
|
|
99
|
-
"putout": "^
|
|
99
|
+
"putout": "^38.0.0",
|
|
100
100
|
"supertape": "^10.0.0"
|
|
101
101
|
},
|
|
102
102
|
"publishConfig": {
|