flatlint 1.93.1 → 1.94.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
|
@@ -57,6 +57,11 @@ export const match = () => ({
|
|
|
57
57
|
return true;
|
|
58
58
|
},
|
|
59
59
|
'],': (vars, path) => {
|
|
60
|
+
for (const token of path.getAllPrev()) {
|
|
61
|
+
if (isPunctuator(token, colon))
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
|
|
60
65
|
let result = false;
|
|
61
66
|
|
|
62
67
|
for (const token of path.getAllNext()) {
|
|
@@ -82,4 +87,3 @@ export const replace = () => ({
|
|
|
82
87
|
'}),': '})',
|
|
83
88
|
'],': '];',
|
|
84
89
|
});
|
|
85
|
-
|
package/lib/runner/path.js
CHANGED
|
@@ -42,6 +42,10 @@ export const createPath = ({tokens, start, end}) => ({
|
|
|
42
42
|
tokens,
|
|
43
43
|
end,
|
|
44
44
|
}),
|
|
45
|
+
isNextTemplateTail: createIsNextTemplateTail({
|
|
46
|
+
tokens,
|
|
47
|
+
end,
|
|
48
|
+
}),
|
|
45
49
|
isPrevPunctuator: createIsPrevPunctuator({
|
|
46
50
|
tokens,
|
|
47
51
|
start,
|
|
@@ -110,12 +114,18 @@ const createIsNextPunctuator = ({tokens, end}) => (punctuators) => {
|
|
|
110
114
|
end,
|
|
111
115
|
});
|
|
112
116
|
|
|
113
|
-
if (!current)
|
|
114
|
-
return false;
|
|
115
|
-
|
|
116
117
|
return isPunctuator(current, punctuators);
|
|
117
118
|
};
|
|
118
119
|
|
|
120
|
+
const createIsNextTemplateTail = ({tokens, end}) => () => {
|
|
121
|
+
const current = getNext({
|
|
122
|
+
tokens,
|
|
123
|
+
end,
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
return isTemplateTail(current);
|
|
127
|
+
};
|
|
128
|
+
|
|
119
129
|
const createGetPrev = ({tokens, start}) => () => {
|
|
120
130
|
return getPrev({
|
|
121
131
|
tokens,
|
package/lib/types/types.js
CHANGED