Skip to content

Commit

Permalink
lint: remove obsolete suppressions
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed May 16, 2024
1 parent b0305d8 commit 31d3f7d
Show file tree
Hide file tree
Showing 53 changed files with 8 additions and 127 deletions.
1 change: 0 additions & 1 deletion packages/ERTP/src/paymentLedger.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @jessie-check

/* eslint-disable no-use-before-define */
import { isPromise } from '@endo/promise-kit';
import { mustMatch, M, keyEQ } from '@agoric/store';
import { AmountMath } from './amountMath.js';
Expand Down
2 changes: 0 additions & 2 deletions packages/SwingSet/src/controller/initializeKernel.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable no-use-before-define */

import { makeMarshal } from '@endo/marshal';
import { Far } from '@endo/far';
import { assert, Fail } from '@agoric/assert';
Expand Down
1 change: 0 additions & 1 deletion packages/SwingSet/src/devices/lib/deviceTools.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export function buildSerializationTools(syscall, deviceName) {
send(method, args) {
assert.typeof(method, 'string');
assert(Array.isArray(args), args);
// eslint-disable-next-line no-use-before-define
const capdata = serialize([method, args]);
syscall.sendOnly(slot, capdata);
},
Expand Down
1 change: 0 additions & 1 deletion packages/SwingSet/src/kernel/kernel.js
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,6 @@ export default function buildKernel(
} else if (message.type === 'changeVatOptions') {
// prettier-ignore
return `changeVatOptions ${message.vatID} options: ${JSON.stringify(message.options)}`;
// eslint-disable-next-line no-use-before-define
} else if (gcMessages.includes(message.type)) {
// prettier-ignore
return `${message.type} ${message.vatID} ${message.krefs.map(e=>`@${e}`).join(' ')}`;
Expand Down
3 changes: 0 additions & 3 deletions packages/SwingSet/src/kernel/state/kernelKeeper.js
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,6 @@ export default function makeKernelKeeper(kernelStorage, kernelSlog) {

let idx = 0;
for (const dataSlot of capdata.slots) {
// eslint-disable-next-line no-use-before-define
incrementRefCount(dataSlot, `resolve|${kernelSlot}|s${idx}`);
idx += 1;
}
Expand All @@ -787,7 +786,6 @@ export default function makeKernelKeeper(kernelStorage, kernelSlog) {

function cleanupAfterTerminatedVat(vatID) {
insistVatID(vatID);
// eslint-disable-next-line no-use-before-define
const vatKeeper = provideVatKeeper(vatID);
const exportPrefix = `${vatID}.c.o+`;
const importPrefix = `${vatID}.c.o-`;
Expand Down Expand Up @@ -1262,7 +1260,6 @@ export default function makeKernelKeeper(kernelStorage, kernelSlog) {
if (reachable === 0) {
const ownerVatID = ownerOfKernelObject(kref);
if (ownerVatID) {
// eslint-disable-next-line no-use-before-define
const vatKeeper = provideVatKeeper(ownerVatID);
const isReachable = vatKeeper.getReachableFlag(kref);
if (isReachable) {
Expand Down
2 changes: 0 additions & 2 deletions packages/SwingSet/src/kernel/vat-warehouse.js
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,6 @@ export function makeVatWarehouse({
// entriesReplayed, // retval of replayTranscript() above
// );
ephemeral.vats.set(vatID, result);
// eslint-disable-next-line no-use-before-define
await applyAvailabilityPolicy(vatID);
return result;
}
Expand Down Expand Up @@ -592,7 +591,6 @@ export function makeVatWarehouse({
//
/** @type { KernelDeliveryObject } */
const kd = harden(['bringOutYourDead']);
// eslint-disable-next-line no-use-before-define
const vd = kernelDeliveryToVatDelivery(vatID, kd);
const vs = kernelSlog.provideVatSlogger(vatID).vatSlog;
await deliverToVat(vatID, kd, vd, vs);
Expand Down
2 changes: 0 additions & 2 deletions packages/SwingSet/src/vats/comms/delivery.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable no-use-before-define */

import { assert, Fail } from '@agoric/assert';
import { kser } from '@agoric/kmarshal';
import { parseLocalSlot, insistLocalType } from './parseLocalSlots.js';
Expand Down
4 changes: 0 additions & 4 deletions packages/SwingSet/src/vats/comms/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ export function makeState(syscall) {
store.set('r.nextID', '1');
store.set('initialized', 'true');
if (controller) {
// eslint-disable-next-line no-use-before-define
addMetaObject(controller);
cdebug(`comms controller is ${controller}`);
}
Expand Down Expand Up @@ -393,7 +392,6 @@ export function makeState(syscall) {
// the object is unreachable

const { owner, isReachable, isRecognizable } =
// eslint-disable-next-line no-use-before-define
getOwnerAndStatus(lref);
if (isReachable) {
// but the exporter doesn't realize it yet, so schedule a
Expand Down Expand Up @@ -558,7 +556,6 @@ export function makeState(syscall) {
isReachable = isReachableByKernel(lref);
isRecognizable = !!mapToKernel(lref);
} else {
// eslint-disable-next-line no-use-before-define
const remote = getRemote(owner);
isReachable = remote.isReachable(lref);
isRecognizable = !!remote.mapToRemote(lref);
Expand Down Expand Up @@ -794,7 +791,6 @@ export function makeState(syscall) {
insistPromiseIsUnresolved,
markPromiseAsResolved,

// eslint-disable-next-line no-use-before-define
getRemote,
addRemote,
getRemoteIDForName,
Expand Down
2 changes: 0 additions & 2 deletions packages/SwingSet/src/vats/timer/vat-timer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable no-use-before-define */

import { Far, E, passStyleOf } from '@endo/far';
import { makePromiseKit } from '@endo/promise-kit';
import { Nat } from '@endo/nat';
Expand Down
4 changes: 0 additions & 4 deletions packages/SwingSet/src/vats/vat-admin/vat-vat-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ export function buildRootObject(vatPowers, _vatParameters, baggage) {
// getNotifier: ({ state }) => state.notifier, // XXX RESTORE
getNotifier: ({ _self }) => Fail`not implemented, see #7234`, // XXX TEMP
},
// eslint-disable-next-line no-use-before-define
{ finish: finishMeter },
);

Expand All @@ -104,18 +103,15 @@ export function buildRootObject(vatPowers, _vatParameters, baggage) {
// getNotifier: ({ state }) => state.notifier, // will never fire // XXX RESTORE
getNotifier: ({ _self }) => Fail`not implemented, see #7234`, // XXX TEMP
},
// eslint-disable-next-line no-use-before-define
{ finish: finishMeter },
);

function finishMeter({ state, self }) {
// eslint-disable-next-line no-use-before-define
meterByID.init(
state.meterID,
// harden({ meter: self, updater: state.updater }), // XXX RESTORE
harden({ meter: self }), // XXX TEMP
);
// eslint-disable-next-line no-use-before-define
meterIDByMeter.set(self, state.meterID);
}

Expand Down
2 changes: 0 additions & 2 deletions packages/SwingSet/tools/baggage-check.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { makeMarshal } from '@endo/marshal';
import { Far } from '@endo/far';

/* eslint-disable no-use-before-define */

function fakeSTV(slot, iface = 'Remotable') {
return Far(iface, {
getSlot: () => slot,
Expand Down
1 change: 0 additions & 1 deletion packages/SwingSet/tools/bootstrap-dvo-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export function buildRootObject() {
async function runTests(phase) {
testLog = [];
doneP = makePromiseKit();
// eslint-disable-next-line no-use-before-define
await E(testVatRoot).runTests(self, phase);
await doneP.promise;
return testLog;
Expand Down
1 change: 0 additions & 1 deletion packages/agoric-cli/src/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ export default async function installMain(progname, rawArgs, powers, opts) {
// Ensure we update the package.json before exiting.
const updatePackageJson = async () => {
// Don't update on exit anymore.
// eslint-disable-next-line no-use-before-define
process.off('beforeExit', updatePackageJsonOnExit);
log.info(`updating ${pjson}`);
await fs.writeFile(
Expand Down
6 changes: 1 addition & 5 deletions packages/casting/src/leader.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export const makeRoundRobinLeader = (endpoints, leaderOptions = {}) => {
}
throw err;
},
// eslint-disable-next-line no-use-before-define
watchCasting: _castingSpecP => pollingChangeFollower,
/**
* @template T
Expand All @@ -55,10 +54,7 @@ export const makeRoundRobinLeader = (endpoints, leaderOptions = {}) => {
});
}

retrying
.then(() => jitter && jitter(where))
// eslint-disable-next-line no-use-before-define
.then(applyOne, reject);
retrying.then(() => jitter && jitter(where)).then(applyOne, reject);
thisAttempt += 1;
};

Expand Down
1 change: 0 additions & 1 deletion packages/cosmic-swingset/src/chain-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ export default async function main(progname, args, { env, homedir, agcc }) {

// Actually run the main ag-chain-cosmos program. Before we start the daemon,
// there will be a call to nodePort/AG_COSMOS_INIT, otherwise exit.
// eslint-disable-next-line no-use-before-define
const nodePort = registerPortHandler(toSwingSet);

// Need to keep the process alive until Go exits.
Expand Down
1 change: 0 additions & 1 deletion packages/cosmic-swingset/src/sim-chain.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ export async function connectToFakeChain(basedir, GCI, delay, inbound) {
await blockingSend({ type: 'COMMIT_BLOCK', blockHeight, blockTime });

clearTimeout(nextBlockTimeout);
// eslint-disable-next-line no-use-before-define
nextBlockTimeout = setTimeout(simulateBlock, maximumDelay);

// TODO: maybe add latency to the inbound messages.
Expand Down
2 changes: 0 additions & 2 deletions packages/governance/src/contractGovernance/paramManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ const makeParamManagerBuilder = (publisherKit, zoe) => {
});

// names are keywords so they will necessarily be TitleCase
// eslint-disable-next-line no-use-before-define
getters[`get${name}`] = () => getTypedParam(type, name);
// CRUCIAL: here we're creating the update functions that can change the
// values of the governed contract's parameters. We'll return the updateFns
Expand Down Expand Up @@ -294,7 +293,6 @@ const makeParamManagerBuilder = (publisherKit, zoe) => {
getVisibleValue,
});

// eslint-disable-next-line no-use-before-define
getters[`get${name}`] = () => getTypedParam(ParamTypes.INVITATION, name);
// CRUCIAL: here we're creating the update functions that can change the
// values of the governed contract's parameters. We'll return updateParams
Expand Down
2 changes: 0 additions & 2 deletions packages/inter-protocol/src/auction/auctioneer.js
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,6 @@ export const start = async (zcf, privateArgs, baggage) => {
},
});

// eslint-disable-next-line no-use-before-define
const isActive = () => scheduler.getAuctionState() === AuctionState.ACTIVE;

/**
Expand Down Expand Up @@ -655,7 +654,6 @@ export const start = async (zcf, privateArgs, baggage) => {
);
},
getSchedules() {
// eslint-disable-next-line no-use-before-define
return scheduler.getSchedule();
},
getScheduleUpdates() {
Expand Down
1 change: 0 additions & 1 deletion packages/inter-protocol/src/auction/scheduler.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ export const makeScheduler = async (
try {
setTimeMonotonically(time);
auctionDriver.capturePrices();
// eslint-disable-next-line no-use-before-define
return startAuction();
} catch (e) {
console.error(`⚠️ Auction threw ${e}. Caught in SchedulerWaker.`);
Expand Down
4 changes: 2 additions & 2 deletions packages/internal/src/node/fs-stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ export const fsStreamReady = stream =>
}

const onReady = () => {
cleanup(); // eslint-disable-line no-use-before-define
cleanup();
resolve();
};

/** @param {Error} err */
const onError = err => {
cleanup(); // eslint-disable-line no-use-before-define
cleanup();
reject(err);
};

Expand Down
1 change: 0 additions & 1 deletion packages/internal/src/node/shutdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export const makeFreshShutdown = (verbose = true) => {
process.off('SIGINT', shutdown);
process.off('SIGTERM', shutdown);
process.off('beforeExit', shutdown);
// eslint-disable-next-line no-use-before-define
process.off('uncaughtException', uncaughtShutdown);
verbose && console.error(`Shutting down cleanly...`);
const shutdowners = [...shutdownThunks.keys()];
Expand Down
1 change: 0 additions & 1 deletion packages/notifier/test/map-unum.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export const makeMapLeader = initialEntries => {

const change = delta => {
if (deltaCount >= m.size) {
// eslint-disable-next-line no-use-before-define
snapshot();
} else {
deltaPublication.updateState(delta);
Expand Down
1 change: 0 additions & 1 deletion packages/orchestration/src/orchestration-api.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable no-use-before-define */
/**
* @file General API of orchestration
* - must not have chain-specific types without runtime narrowing by chain id
Expand Down
1 change: 0 additions & 1 deletion packages/pegasus/src/pegasus.js
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,6 @@ export const makePegasus = ({ zcf, board, namesByAddress, when }) => {
receiveDenomPublication,
remoteDenomSubscription,
abort: reason => {
// eslint-disable-next-line no-use-before-define
actions.abort(reason);
},
};
Expand Down
2 changes: 0 additions & 2 deletions packages/solo/src/chain-cosmos-sdk.js
Original file line number Diff line number Diff line change
Expand Up @@ -696,14 +696,12 @@ ${chainID} chain does not yet know of address ${clientAddr}${adviseEgress(
.then(txResult => {
// The result had an error code (not 0 or undefined for success).
if (txResult.code) {
// eslint-disable-next-line no-use-before-define
failedSend(
assert.error(`Error in tx processing: ${txResult.log}`),
);
}
})
.catch(err =>
// eslint-disable-next-line no-use-before-define
failedSend(assert.error(`Error in tx processing: ${err}`)),
);

Expand Down
1 change: 0 additions & 1 deletion packages/solo/src/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ const buildSwingset = async (
const withInputQueue = makeWithQueue();
const queueThunkForKernel = withInputQueue(async thunk => {
thunk();
// eslint-disable-next-line no-use-before-define
await processKernel();
});

Expand Down
1 change: 0 additions & 1 deletion packages/solo/src/vat-http.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export function buildRootObject(vatPowers) {

const lookup = async (...path) => {
// Take a snapshot of the current home.
// eslint-disable-next-line no-use-before-define
const root = replObjects.home;

if (path.length === 1 && Array.isArray(path[0])) {
Expand Down
1 change: 0 additions & 1 deletion packages/solo/src/web.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,6 @@ export async function makeHTTPListener(
return;
}

// eslint-disable-next-line no-use-before-define
sendJSON({ ...res, meta });
} catch (error) {
inboundCommand(
Expand Down
1 change: 0 additions & 1 deletion packages/swing-store/src/hasher.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { createHash } from 'crypto';
function createSHA256(initial = undefined) {
const hash = createHash('sha256');
let done = false;
// eslint-disable-next-line no-use-before-define
const self = harden({ add, finish, sample });
function add(more) {
!done || Fail`hash already finished`;
Expand Down
Loading

0 comments on commit 31d3f7d

Please sign in to comment.