Skip to content

Commit

Permalink
fixup! suppress inconsistent lint type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
erights committed Jan 21, 2025
1 parent 74fc5e8 commit 9b20c1b
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 6 deletions.
12 changes: 10 additions & 2 deletions packages/immutable-arraybuffer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down
5 changes: 5 additions & 0 deletions packages/marshal/src/encodeToCapData.js
Original file line number Diff line number Diff line change
Expand Up @@ -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])]),
);
Expand Down
6 changes: 5 additions & 1 deletion packages/pass-style/src/symbol.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
11 changes: 10 additions & 1 deletion packages/ses/src/error/assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -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, {
Expand Down
9 changes: 7 additions & 2 deletions packages/ses/src/make-hardener.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, []),
});
}
Expand Down

0 comments on commit 9b20c1b

Please sign in to comment.