Skip to content

Commit 28730fe

Browse files
committed
Added js-check.
1 parent 7df95b3 commit 28730fe

16 files changed

Lines changed: 62 additions & 11 deletions

.clinerules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<!-- Canonical source: AGENTS.md — keep this file in sync -->
21
# time-queues — AI Agent Rules
32

43
## Project identity
@@ -11,7 +10,7 @@ For detailed usage docs and API references see the [wiki](https://github.com/uho
1110
## Setup
1211

1312
```bash
14-
git clone --recurse-submodules git@github.com:uhop/time-queues.git
13+
git clone --recurse-submodules https://github.com/uhop/time-queues.git
1514
cd time-queues
1615
npm install
1716
```
@@ -23,6 +22,7 @@ npm install
2322
- `npm run test:bun` — run with Bun
2423
- `npm run test:deno` — run with Deno
2524
- `npm run ts-check` — TypeScript type checking (tsc --noEmit)
25+
- `npm run js-check` — JS lint via TypeScript (`tsconfig.check.json`: unused vars / undeclared refs / missing returns / unreachable code)
2626
- `npm run ts-test` — run TS typing tests
2727
- `npm run lint` — Prettier format check
2828
- `npm run lint:fix` — Prettier auto-format

.cursorrules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<!-- Canonical source: AGENTS.md — keep this file in sync -->
21
# time-queues — AI Agent Rules
32

43
## Project identity
@@ -11,7 +10,7 @@ For detailed usage docs and API references see the [wiki](https://github.com/uho
1110
## Setup
1211

1312
```bash
14-
git clone --recurse-submodules git@github.com:uhop/time-queues.git
13+
git clone --recurse-submodules https://github.com/uhop/time-queues.git
1514
cd time-queues
1615
npm install
1716
```
@@ -23,6 +22,7 @@ npm install
2322
- `npm run test:bun` — run with Bun
2423
- `npm run test:deno` — run with Deno
2524
- `npm run ts-check` — TypeScript type checking (tsc --noEmit)
25+
- `npm run js-check` — JS lint via TypeScript (`tsconfig.check.json`: unused vars / undeclared refs / missing returns / unreachable code)
2626
- `npm run ts-test` — run TS typing tests
2727
- `npm run lint` — Prettier format check
2828
- `npm run lint:fix` — Prettier auto-format

.github/workflows/tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@ jobs:
3131
npm ci
3232
npm test
3333
npm run ts-check --if-present
34+
npm run js-check --if-present

.windsurfrules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<!-- Canonical source: AGENTS.md — keep this file in sync -->
21
# time-queues — AI Agent Rules
32

43
## Project identity
@@ -11,7 +10,7 @@ For detailed usage docs and API references see the [wiki](https://github.com/uho
1110
## Setup
1211

1312
```bash
14-
git clone --recurse-submodules git@github.com:uhop/time-queues.git
13+
git clone --recurse-submodules https://github.com/uhop/time-queues.git
1514
cd time-queues
1615
npm install
1716
```
@@ -23,6 +22,7 @@ npm install
2322
- `npm run test:bun` — run with Bun
2423
- `npm run test:deno` — run with Deno
2524
- `npm run ts-check` — TypeScript type checking (tsc --noEmit)
25+
- `npm run js-check` — JS lint via TypeScript (`tsconfig.check.json`: unused vars / undeclared refs / missing returns / unreachable code)
2626
- `npm run ts-test` — run TS typing tests
2727
- `npm run lint` — Prettier format check
2828
- `npm run lint:fix` — Prettier auto-format

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ npm install
2222
- `npm run test:bun` — run with Bun
2323
- `npm run test:deno` — run with Deno
2424
- `npm run ts-check` — TypeScript type checking (tsc --noEmit)
25+
- `npm run js-check` — JS lint via TypeScript (`tsconfig.check.json`: unused vars / undeclared refs / missing returns / unreachable code)
2526
- `npm run ts-test` — run TS typing tests
2627
- `npm run lint` — Prettier format check
2728
- `npm run lint:fix` — Prettier auto-format

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"test:seq:bun": "bun run `tape6-seq --self` --flags FO",
1919
"test:seq:deno": "deno run -A `tape6-seq --self` --flags FO",
2020
"ts-check": "tsc --noEmit",
21+
"js-check": "tsc --project tsconfig.check.json",
2122
"ts-test": "tape6 --flags FO '/ts-tests/test-*.*ts'",
2223
"ts-test:bun": "tape6-bun --flags FO '/ts-tests/test-*.*ts'",
2324
"ts-test:deno": "tape6-deno --flags FO '/ts-tests/test-*.*ts'",

src/ListQueue.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import List from 'list-toolkit/list.js';
12
import {MicroTask} from './MicroTask.js';
23
import {MicroTaskQueue} from './MicroTaskQueue.js';
34

@@ -11,6 +12,11 @@ export declare class ListQueue extends MicroTaskQueue {
1112
*/
1213
paused: boolean;
1314

15+
/**
16+
* The linked list of pending microtasks.
17+
*/
18+
list: List<MicroTask>;
19+
1420
/**
1521
* The function that stops the queue.
1622
* It is used internally by `pause()` and `resume()`.

src/ListQueue.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
// @ts-self-types="./ListQueue.d.ts"
22

33
import List from 'list-toolkit/list.js';
4+
import MicroTask from './MicroTask.js';
45
import MicroTaskQueue from './MicroTaskQueue.js';
56

67
export class ListQueue extends MicroTaskQueue {
78
constructor(paused) {
89
super(paused);
910
// AI-NOTE: Using list-toolkit List for O(1) push/pop operations
11+
/** @type {List<MicroTask>} */
1012
this.list = new List();
1113
// AI-NOTE: stopQueue holds the stop function returned by startQueue(), or null
1214
this.stopQueue = null;

src/MicroTaskQueue.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class MicroTaskQueue {
1919
this.paused = false;
2020
return this;
2121
}
22-
enqueue(fn) {
22+
enqueue(fn, ..._args) {
2323
const task = new MicroTask(fn);
2424
return task;
2525
}

src/PageWatcher.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ export class PageWatcher extends ListQueue {
4444

4545
// Implemented in ListQueue: dequeue()
4646

47-
schedule() {
47+
/** @returns {never} */
48+
schedule(_fn) {
4849
throw new Error('Not implemented');
4950
}
5051

0 commit comments

Comments
 (0)