@junoflow/eslint-plugin 0.14.0 → 0.15.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/index.js +18 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -275,7 +275,7 @@ function handleConstructor(p) {
|
|
|
275
275
|
if (obj === 'controls' && method === 'untilPressed') {
|
|
276
276
|
return `controls.${binding}.untilPressed()`;
|
|
277
277
|
}
|
|
278
|
-
return
|
|
278
|
+
return taskCall(p, ['untilDone']);
|
|
279
279
|
}
|
|
280
280
|
|
|
281
281
|
const isWait = (p) => !!isCtxFunction(p, ['wait']);
|
|
@@ -338,6 +338,20 @@ function isSuspending(p) {
|
|
|
338
338
|
return isWait(p) || isSleep(p) || !!isFlowInvoke(p);
|
|
339
339
|
}
|
|
340
340
|
|
|
341
|
+
/**
|
|
342
|
+
* `tasks.<binding>.<method>` bare or directly on `ctx` — never as the tail of
|
|
343
|
+
* an arbitrary chain, where `this.tasks.x.open` is someone else's. The display
|
|
344
|
+
* name, or null.
|
|
345
|
+
*/
|
|
346
|
+
function taskCall(p, methods) {
|
|
347
|
+
if (!p) return null;
|
|
348
|
+
const q = p.length === 4 && p[0] === 'ctx' ? p.slice(1) : p;
|
|
349
|
+
if (q.length !== 3 || q[0] !== 'tasks' || !methods.includes(q[2])) {
|
|
350
|
+
return null;
|
|
351
|
+
}
|
|
352
|
+
return `tasks.${q[1]}.${q[2]}()`;
|
|
353
|
+
}
|
|
354
|
+
|
|
341
355
|
/** Recorded in the journal, so it must not be replayed from inside a step. */
|
|
342
356
|
function journaledKind(p) {
|
|
343
357
|
const step = isStepCall(p);
|
|
@@ -350,6 +364,9 @@ function journaledKind(p) {
|
|
|
350
364
|
if (finding) return `findings.${finding}()`;
|
|
351
365
|
if (isStateCall(p) === 'scoped') return 'state.scoped()';
|
|
352
366
|
if (isCtxFunction(p, ['notify'])) return 'notify()';
|
|
367
|
+
// `__task:<n>`: one counter per execution, notify's pattern.
|
|
368
|
+
const open = taskCall(p, ['open']);
|
|
369
|
+
if (open) return open;
|
|
353
370
|
return null;
|
|
354
371
|
}
|
|
355
372
|
|