flatlint 2.0.10 → 2.1.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,9 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
closeSquareBrace,
|
|
3
|
+
colon,
|
|
3
4
|
isOneOfKeywords,
|
|
4
5
|
isPunctuator,
|
|
5
6
|
} from '#types';
|
|
6
7
|
|
|
8
|
+
const keywords = [
|
|
9
|
+
'readonly',
|
|
10
|
+
'static',
|
|
11
|
+
'implements',
|
|
12
|
+
'interface',
|
|
13
|
+
'class',
|
|
14
|
+
];
|
|
15
|
+
|
|
7
16
|
export const report = () => `Use ',' instead of ';'`;
|
|
8
17
|
|
|
9
18
|
export const match = () => ({
|
|
@@ -12,12 +21,7 @@ export const match = () => ({
|
|
|
12
21
|
return false;
|
|
13
22
|
|
|
14
23
|
for (const token of path.getAllPrev()) {
|
|
15
|
-
if (isOneOfKeywords(token,
|
|
16
|
-
'readonly',
|
|
17
|
-
'static',
|
|
18
|
-
'implements',
|
|
19
|
-
'interface',
|
|
20
|
-
]))
|
|
24
|
+
if (isOneOfKeywords(token, keywords))
|
|
21
25
|
return false;
|
|
22
26
|
}
|
|
23
27
|
|
|
@@ -25,27 +29,40 @@ export const match = () => ({
|
|
|
25
29
|
if (isPunctuator(token, closeSquareBrace))
|
|
26
30
|
return true;
|
|
27
31
|
}
|
|
32
|
+
|
|
33
|
+
return false;
|
|
28
34
|
},
|
|
29
35
|
'__a: __expr;': (vars, path) => {
|
|
30
36
|
if (path.isPrevDeclarationKeyword())
|
|
31
37
|
return false;
|
|
32
38
|
|
|
33
|
-
const keywords = [
|
|
34
|
-
'class',
|
|
35
|
-
'readonly',
|
|
36
|
-
'static',
|
|
37
|
-
'implements',
|
|
38
|
-
];
|
|
39
|
-
|
|
40
39
|
for (const token of path.getAllPrev())
|
|
41
40
|
if (isOneOfKeywords(token, keywords))
|
|
42
41
|
return false;
|
|
43
42
|
|
|
44
43
|
return true;
|
|
45
44
|
},
|
|
45
|
+
');': (vars, path) => {
|
|
46
|
+
if (!path.isNext())
|
|
47
|
+
return false;
|
|
48
|
+
|
|
49
|
+
for (const token of path.getAllPrev()) {
|
|
50
|
+
if (isOneOfKeywords(token, keywords))
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
for (const token of path.getAllPrev()) {
|
|
55
|
+
if (isPunctuator(token, colon))
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return false;
|
|
60
|
+
},
|
|
46
61
|
});
|
|
47
62
|
|
|
48
63
|
export const replace = () => ({
|
|
49
64
|
'__a: __expr;': '__a: __expr,',
|
|
50
65
|
'__a;': '__a,',
|
|
66
|
+
');': '),',
|
|
51
67
|
});
|
|
68
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flatlint",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "JavaScript tokens-based linter",
|
|
5
5
|
"main": "lib/flatlint.js",
|
|
6
6
|
"type": "module",
|
|
@@ -88,10 +88,10 @@
|
|
|
88
88
|
"devDependencies": {
|
|
89
89
|
"@putout/eslint-flat": "^2.0.0",
|
|
90
90
|
"@putout/formatter-json": "^2.0.0",
|
|
91
|
-
"@putout/test": "^
|
|
91
|
+
"@putout/test": "^12.0.1",
|
|
92
92
|
"c8": "^10.1.2",
|
|
93
93
|
"eslint": "^9.7.0",
|
|
94
|
-
"eslint-plugin-putout": "^
|
|
94
|
+
"eslint-plugin-putout": "^25.0.2",
|
|
95
95
|
"madrun": "^10.2.2",
|
|
96
96
|
"mock-require": "^3.0.3",
|
|
97
97
|
"montag": "^1.0.0",
|