Skip to content

Commit 7ab2643

Browse files
committed
fixup! suppress inconsistent lint type errors
1 parent 74fc5e8 commit 7ab2643

File tree

5 files changed

+32
-5
lines changed

5 files changed

+32
-5
lines changed

packages/immutable-arraybuffer/index.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,11 @@ export const transferBufferToImmutable = (buffer, newLength = undefined) => {
165165

166166
export const isBufferImmutable = buffer => {
167167
try {
168-
// @ts-expect-error Getter should be typed as this-sensitive
168+
// TODO The following directive line should either be removed or
169+
// turned back into an at-ts-expect-error. We made it into an
170+
// at-ts-ignore because we were getting inconsistent reports.
171+
// See https://github.com/endojs/endo/pull/2673#issuecomment-2566711810
172+
// @ts-ignore Getter should be typed as this-sensitive
169173
return apply(isImmutableGetter, buffer, []);
170174
} catch (err) {
171175
if (err instanceof TypeError) {
@@ -179,7 +183,11 @@ export const isBufferImmutable = buffer => {
179183

180184
const sliceBuffer = (buffer, start = undefined, end = undefined) => {
181185
try {
182-
// @ts-expect-error We know it is really there
186+
// TODO The following directive line should either be removed or
187+
// turned back into an at-ts-expect-error. We made it into an
188+
// at-ts-ignore because we were getting inconsistent reports.
189+
// See https://github.com/endojs/endo/pull/2673#issuecomment-2566711810
190+
// @ts-ignore We know it is really there
183191
return apply(sliceOfImmutable, buffer, [start, end]);
184192
} catch (err) {
185193
if (err instanceof TypeError) {

packages/marshal/src/encodeToCapData.js

+5
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,11 @@ export const makeEncodeToCapData = (encodeOptions = {}) => {
187187
// work. If we allow sortable symbol keys, this will need to
188188
// become more interesting.
189189
const names = ownKeys(passable).sort();
190+
// TODO The following directive line should either be removed or
191+
// turned back into an at-ts-expect-error. We made it into an
192+
// at-ts-ignore because we were getting inconsistent reports.
193+
// See https://github.com/endojs/endo/pull/2673#issuecomment-2566711810
194+
// @ts-ignore Apparent confusion about `@qclass`
190195
return fromEntries(
191196
names.map(name => [name, encodeToCapDataRecur(passable[name])]),
192197
);

packages/pass-style/src/symbol.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ const wellKnownSymbolNames = new Map(
1111
name => typeof name === 'string' && typeof Symbol[name] === 'symbol',
1212
)
1313
.filter(name => {
14-
// @ts-expect-error It doesn't know name cannot be a symbol
14+
// TODO The following directive line should either be removed or
15+
// turned back into an at-ts-expect-error. We made it into an
16+
// at-ts-ignore because we were getting inconsistent reports.
17+
// See https://github.com/endojs/endo/pull/2673#issuecomment-2566711810
18+
// @ts-ignore It doesn't know name cannot be a symbol
1519
!name.startsWith('@@') ||
1620
Fail`Did not expect Symbol to have a symbol-valued property name starting with "@@" ${q(
1721
name,

packages/ses/src/error/assert.js

+5
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,11 @@ export const sanitizeError = error => {
293293
} = descs;
294294

295295
const restNames = ownKeys(restDescs);
296+
// TODO vscode mouse hover shows that TS knows that `restNames` is an
297+
// array and therefore that `restNames.length` is a number.
298+
// But this isn't a TS error anyway, it seems to be an eslint error.
299+
// I have no idea what eslint's type checking theory is.
300+
// eslint-disable-next-line @endo/restrict-comparison-operands
296301
if (restNames.length >= 1) {
297302
for (const name of restNames) {
298303
delete error[name];

packages/ses/src/make-hardener.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,14 @@ export const makeHardener = () => {
238238
// NOTE: Calls getter during harden, which seems dangerous.
239239
// But we're only calling the problematic getter whose
240240
// hazards we think we understand.
241-
// @ts-expect-error TS should know FERAL_STACK_GETTER
242-
// cannot be `undefined` here.
241+
//
242+
// TODO The following directive line should either be removed or
243+
// turned back into an at-ts-expect-error. We made it into an
244+
// at-ts-ignore because we were getting inconsistent reports.
245+
// See https://github.com/endojs/endo/pull/2673#issuecomment-2566711810
243246
// See https://github.com/endojs/endo/pull/2232#discussion_r1575179471
247+
// @ts-ignore TS should know FERAL_STACK_GETTER
248+
// cannot be `undefined` here.
244249
value: apply(FERAL_STACK_GETTER, obj, []),
245250
});
246251
}

0 commit comments

Comments
 (0)