flatlint 1.101.1 → 1.103.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,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
closeRoundBrace,
|
|
3
|
+
colon,
|
|
3
4
|
isKeyword,
|
|
4
5
|
isPunctuator,
|
|
5
6
|
openRoundBrace,
|
|
@@ -30,6 +31,9 @@ export const match = () => ({
|
|
|
30
31
|
'__a;': (vars, path) => {
|
|
31
32
|
let result = false;
|
|
32
33
|
|
|
34
|
+
if (path.isPrevPunctuator(colon))
|
|
35
|
+
return false;
|
|
36
|
+
|
|
33
37
|
for (const current of path.getAllPrev()) {
|
|
34
38
|
if (isPunctuator(current, openRoundBrace)) {
|
|
35
39
|
result = true;
|
|
@@ -1,21 +1,29 @@
|
|
|
1
1
|
import {
|
|
2
2
|
closeSquareBrace,
|
|
3
3
|
isIdentifier,
|
|
4
|
+
isOneOfKeywords,
|
|
5
|
+
isOneOfPunctuators,
|
|
4
6
|
isPunctuator,
|
|
7
|
+
more,
|
|
5
8
|
} from '#types';
|
|
6
9
|
|
|
7
10
|
export const report = () => `Use ',' instead of ';'`;
|
|
8
11
|
|
|
9
12
|
export const match = () => ({
|
|
10
13
|
'__a;': (vars, path) => {
|
|
14
|
+
for (const token of path.getAllPrev()) {
|
|
15
|
+
if (isOneOfKeywords(token, ['readonly', 'static', 'implements']))
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
|
|
11
19
|
for (const token of path.getAllNext()) {
|
|
12
20
|
if (isPunctuator(token, closeSquareBrace))
|
|
13
21
|
return true;
|
|
14
22
|
}
|
|
15
23
|
},
|
|
16
|
-
'__a: __expr;': (
|
|
24
|
+
'__a: __expr;': ({__expr}, path) => {
|
|
17
25
|
for (const token of path.getAllPrev()) {
|
|
18
|
-
if (
|
|
26
|
+
if (isOneOfKeywords(token, ['readonly', 'static', 'implements']))
|
|
19
27
|
return false;
|
|
20
28
|
}
|
|
21
29
|
|
package/lib/types/types.js
CHANGED
|
@@ -145,9 +145,11 @@ export const comma = Punctuator(',');
|
|
|
145
145
|
export const dot = Punctuator('.');
|
|
146
146
|
export const question = Punctuator('?');
|
|
147
147
|
export const more = Punctuator('>');
|
|
148
|
+
export const less = Punctuator('<');
|
|
148
149
|
export const assign = Punctuator('=');
|
|
149
150
|
export const openRoundBrace = Punctuator('(');
|
|
150
151
|
export const or = Punctuator('||');
|
|
152
|
+
export const binaryOr = Punctuator('|');
|
|
151
153
|
export const spread = Punctuator('...');
|
|
152
154
|
export const rest = Punctuator('...');
|
|
153
155
|
export const semicolon = Punctuator(';');
|