flatlint 2.0.4 → 2.0.5
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
|
@@ -19,6 +19,9 @@ export const match = () => ({
|
|
|
19
19
|
'__a(__args),': (vars, path) => {
|
|
20
20
|
const punctuators = [colon, spread];
|
|
21
21
|
|
|
22
|
+
if (path.isNextDeclarationKeyword())
|
|
23
|
+
return false;
|
|
24
|
+
|
|
22
25
|
for (const token of path.getAllPrev()) {
|
|
23
26
|
if (isOneOfPunctuators(token, punctuators))
|
|
24
27
|
return false;
|
package/lib/runner/path.js
CHANGED
|
@@ -44,6 +44,10 @@ export const createPath = ({tokens, start, end}) => ({
|
|
|
44
44
|
tokens,
|
|
45
45
|
end,
|
|
46
46
|
}),
|
|
47
|
+
isNextDeclarationKeyword: createIsNextDeclarationKeyword({
|
|
48
|
+
tokens,
|
|
49
|
+
end,
|
|
50
|
+
}),
|
|
47
51
|
isNextPunctuator: createIsNextPunctuator({
|
|
48
52
|
tokens,
|
|
49
53
|
end,
|
|
@@ -123,6 +127,15 @@ const createIsNextKeyword = ({tokens, end}) => () => {
|
|
|
123
127
|
return isKeyword(current);
|
|
124
128
|
};
|
|
125
129
|
|
|
130
|
+
const createIsNextDeclarationKeyword = ({tokens, end}) => () => {
|
|
131
|
+
const current = getNext({
|
|
132
|
+
tokens,
|
|
133
|
+
end,
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
return isDeclarationKeyword(current);
|
|
137
|
+
};
|
|
138
|
+
|
|
126
139
|
const createIsNextPunctuator = ({tokens, end}) => (punctuators) => {
|
|
127
140
|
const current = getNext({
|
|
128
141
|
tokens,
|