mirror of
https://github.com/stablyai/orca.git
synced 2026-09-22 16:02:32 +00:00
test(relay): put the countingIterator SAFETY: directive on the line oxlint flags
The diagnostic points at the `return {` that opens the object literal, not at the
`} as IterableIterator<T>` that closes it, so disable-next-line has to sit above the
statement.
This commit is contained in:
@@ -16,6 +16,7 @@ class CountingMap<K, V> extends Map<K, V> {
|
||||
const bump = (): void => {
|
||||
this.visits++
|
||||
}
|
||||
// oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the literal returned here implements next() and [Symbol.iterator](), which is the whole protocol a for..of over this wrapper reaches; no other IterableIterator member is ever called.
|
||||
return {
|
||||
next(): IteratorResult<T> {
|
||||
const r = inner.next()
|
||||
@@ -27,7 +28,6 @@ class CountingMap<K, V> extends Map<K, V> {
|
||||
[Symbol.iterator]() {
|
||||
return this
|
||||
}
|
||||
// oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the literal above implements next() and [Symbol.iterator](), which is the whole protocol a for..of over this wrapper reaches; no other IterableIterator member is ever called.
|
||||
} as IterableIterator<T>
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user