diff --git a/packages/immutable-arraybuffer/index.js b/packages/immutable-arraybuffer/index.js index 10625d142e..0bcf61970e 100644 --- a/packages/immutable-arraybuffer/index.js +++ b/packages/immutable-arraybuffer/index.js @@ -165,7 +165,11 @@ export const transferBufferToImmutable = (buffer, newLength = undefined) => { export const isBufferImmutable = buffer => { try { - // @ts-expect-error Getter should be typed as this-sensitive + // TODO The following directive line should either be removed or + // turned back into an at-ts-expect-error. We made it into an + // at-ts-ignore because we were getting inconsistent reports. + // See https://github.com/endojs/endo/pull/2673#issuecomment-2566711810 + // @ts-ignore Getter should be typed as this-sensitive return apply(isImmutableGetter, buffer, []); } catch (err) { if (err instanceof TypeError) { @@ -179,7 +183,11 @@ export const isBufferImmutable = buffer => { const sliceBuffer = (buffer, start = undefined, end = undefined) => { try { - // @ts-expect-error We know it is really there + // TODO The following directive line should either be removed or + // turned back into an at-ts-expect-error. We made it into an + // at-ts-ignore because we were getting inconsistent reports. + // See https://github.com/endojs/endo/pull/2673#issuecomment-2566711810 + // @ts-ignore We know it is really there return apply(sliceOfImmutable, buffer, [start, end]); } catch (err) { if (err instanceof TypeError) { diff --git a/packages/marshal/src/encodeToCapData.js b/packages/marshal/src/encodeToCapData.js index 052b5795a1..c89ddbf9fa 100644 --- a/packages/marshal/src/encodeToCapData.js +++ b/packages/marshal/src/encodeToCapData.js @@ -187,6 +187,11 @@ export const makeEncodeToCapData = (encodeOptions = {}) => { // work. If we allow sortable symbol keys, this will need to // become more interesting. const names = ownKeys(passable).sort(); + // TODO The following directive line should either be removed or + // turned back into an at-ts-expect-error. We made it into an + // at-ts-ignore because we were getting inconsistent reports. + // See https://github.com/endojs/endo/pull/2673#issuecomment-2566711810 + // @ts-ignore Apparent confusion about `@qclass` return fromEntries( names.map(name => [name, encodeToCapDataRecur(passable[name])]), ); diff --git a/packages/pass-style/src/symbol.js b/packages/pass-style/src/symbol.js index ca01808206..84b545e224 100644 --- a/packages/pass-style/src/symbol.js +++ b/packages/pass-style/src/symbol.js @@ -11,7 +11,11 @@ const wellKnownSymbolNames = new Map( name => typeof name === 'string' && typeof Symbol[name] === 'symbol', ) .filter(name => { - // @ts-expect-error It doesn't know name cannot be a symbol + // TODO The following directive line should either be removed or + // turned back into an at-ts-expect-error. We made it into an + // at-ts-ignore because we were getting inconsistent reports. + // See https://github.com/endojs/endo/pull/2673#issuecomment-2566711810 + // @ts-ignore It doesn't know name cannot be a symbol !name.startsWith('@@') || Fail`Did not expect Symbol to have a symbol-valued property name starting with "@@" ${q( name, diff --git a/packages/ses/src/error/assert.js b/packages/ses/src/error/assert.js index f4a645c5b0..635a012467 100644 --- a/packages/ses/src/error/assert.js +++ b/packages/ses/src/error/assert.js @@ -293,6 +293,11 @@ export const sanitizeError = error => { } = descs; const restNames = ownKeys(restDescs); + // TODO vscode mouse hover shows that TS knows that `restNames` is an + // array and therefore that `restNames.length` is a number. + // But this isn't a TS error anyway, it seems to be an eslint error. + // I have no idea what eslint's type checking theory is. + // eslint-disable-next-line @endo/restrict-comparison-operands if (restNames.length >= 1) { for (const name of restNames) { delete error[name]; @@ -305,7 +310,11 @@ export const sanitizeError = error => { ); } for (const name of ownKeys(error)) { - // @ts-expect-error TS still confused by symbols as property names + // TODO The following directive line should either be removed or + // turned back into an at-ts-expect-error. We made it into an + // at-ts-ignore because we were getting inconsistent reports. + // See https://github.com/endojs/endo/pull/2673#issuecomment-2566711810 + // @ts-ignore TS still confused by symbols as property names const desc = descs[name]; if (desc && objectHasOwnProperty(desc, 'get')) { defineProperty(error, name, { diff --git a/packages/ses/src/make-hardener.js b/packages/ses/src/make-hardener.js index d377fd8793..eba2d8ce41 100644 --- a/packages/ses/src/make-hardener.js +++ b/packages/ses/src/make-hardener.js @@ -238,9 +238,14 @@ export const makeHardener = () => { // NOTE: Calls getter during harden, which seems dangerous. // But we're only calling the problematic getter whose // hazards we think we understand. - // @ts-expect-error TS should know FERAL_STACK_GETTER - // cannot be `undefined` here. + // + // TODO The following directive line should either be removed or + // turned back into an at-ts-expect-error. We made it into an + // at-ts-ignore because we were getting inconsistent reports. + // See https://github.com/endojs/endo/pull/2673#issuecomment-2566711810 // See https://github.com/endojs/endo/pull/2232#discussion_r1575179471 + // @ts-ignore TS should know FERAL_STACK_GETTER + // cannot be `undefined` here. value: apply(FERAL_STACK_GETTER, obj, []), }); }