Skip to content

Commit

Permalink
Merge pull request #8442 from Agoric/ta/remove-unused-eslint-disable-…
Browse files Browse the repository at this point in the history
…directives

chore: remove unused eslint disable directives
  • Loading branch information
mergify[bot] committed Mar 8, 2024
2 parents 32c4d68 + 1e62207 commit 5d5ee65
Show file tree
Hide file tree
Showing 88 changed files with 343 additions and 650 deletions.
7 changes: 3 additions & 4 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable no-restricted-syntax */
/* eslint-env node */

const deprecatedForLoanContract = [
Expand Down Expand Up @@ -47,10 +46,10 @@ module.exports = {
},
plugins: ['@typescript-eslint', 'prettier'],
extends: ['@agoric', 'plugin:ava/recommended'],
rules: {
// UNTIL on Endo with https://github.com/endojs/endo/pull/2032
'@endo/no-nullish-coalescing': 'off',
// XXX false positive: Unused eslint-disable directive (no problems were reported from 'max-len')
reportUnusedDisableDirectives: true,

rules: {
'@typescript-eslint/prefer-ts-expect-error': 'warn',
'@typescript-eslint/no-floating-promises': 'error',
// so that floating-promises can be explicitly permitted with void operator
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
"ava": "^5.3.0",
"c8": "^7.13.0",
"conventional-changelog-conventionalcommits": "^4.6.0",
"eslint": "^8.47.0",
"eslint": "^8.57.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-jessie": "^0.0.6",
"eslint-config-prettier": "^9.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-ava": "^14.0.0",
"eslint-plugin-github": "^4.10.0",
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-jsdoc": "^46.4.3",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-github": "^4.10.2",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsdoc": "^47.0.2",
"eslint-plugin-prettier": "^5.1.3",
"lerna": "^5.6.2",
"npm-run-all": "^4.1.5",
"prettier": "^3.0.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/ERTP/src/purse.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export const preparePurseKind = (
getAllegedBrand() {
return brand;
},
// eslint-disable-next-line no-use-before-define

getDepositFacet() {
return this.facets.depositFacet;
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// eslint-disable-next-line import/order
import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava.js';

// eslint-disable-next-line import/order
import { assert } from '@agoric/assert';
import { buildVatController } from '@agoric/swingset-vat';

Expand Down
2 changes: 1 addition & 1 deletion packages/ERTP/test/unitTests/test-inputValidation.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ test('issuer.combine bad payments array', async t => {
split: () => {},
};
// @ts-expect-error Intentional wrong type for testing
// eslint-disable-next-line no-undef

await t.throwsAsync(() => combine(E(issuer).makeEmptyPurse(), notAnArray), {
message: 'srcPaymentsPs is not iterable',
});
Expand Down
2 changes: 1 addition & 1 deletion packages/SwingSet/misc-tools/replay-transcript.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @ts-check

/* global WeakRef FinalizationRegistry */
/* eslint-disable no-constant-condition */

import fs from 'fs';
import '@agoric/internal/src/install-ses-debug.js';

Expand Down
2 changes: 0 additions & 2 deletions packages/SwingSet/src/controller/controller.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* global globalThis, WeakRef, FinalizationRegistry */
/* eslint-disable @typescript-eslint/prefer-ts-expect-error -- https://github.com/Agoric/agoric-sdk/issues/4620 */

import process from 'process';
import crypto from 'crypto';
Expand Down Expand Up @@ -177,7 +176,6 @@ export async function makeSwingsetController(
slogSender(timedObj);
}

// eslint-disable-next-line no-shadow
const console = makeConsole(`${debugPrefix}SwingSet:controller`);
// We can harden this 'console' because it's new, but if we were using the
// original 'console' object (which has a unique prototype), we'd have to
Expand Down
2 changes: 0 additions & 2 deletions packages/SwingSet/src/kernel/kernelSyscall.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable @typescript-eslint/prefer-ts-expect-error -- https://github.com/Agoric/agoric-sdk/issues/4620 */

import { assert, Fail } from '@agoric/assert';
import { insistKernelType } from './parseKernelSlots.js';
import { insistCapData } from '../lib/capdata.js';
Expand Down
1 change: 0 additions & 1 deletion packages/SwingSet/src/lib/capdata.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Fail } from '@agoric/assert';
import { passStyleOf } from '@endo/far';
import { kunser, krefOf } from '@agoric/kmarshal';

/* eslint-disable jsdoc/require-returns-check */
/**
* Assert function to ensure that something expected to be a capdata object
* actually is. A capdata object should have a .body property that's a string
Expand Down
2 changes: 1 addition & 1 deletion packages/SwingSet/src/vats/plugin-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export function makePluginManager(pluginDevice, { D, ...vatPowers }) {
*/
makeStableForwarder(walker = DEFAULT_WALKER) {
let pr;
// eslint-disable-next-line no-new

void new HandledPromise((_resolve, _reject, resolveWithPresence) => {
// Use Remotable rather than Far to make a remote from a presence
pr = Remotable(
Expand Down
2 changes: 1 addition & 1 deletion packages/SwingSet/test/bundling/test-bundles-controller.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @ts-nocheck
// eslint-disable-next-line import/order

import { test } from '../../tools/prepare-test-env-ava.js';

// eslint-disable-next-line import/order
Expand Down
1 change: 0 additions & 1 deletion packages/SwingSet/test/bundling/test-bundles-kernel.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// eslint-disable-next-line import/order
import { test } from '../../tools/prepare-test-env-ava.js';

// eslint-disable-next-line import/order
import crypto from 'crypto';
import bundleSource from '@endo/bundle-source';
import { parseArchive } from '@endo/compartment-mapper';
Expand Down
1 change: 0 additions & 1 deletion packages/SwingSet/test/devices/test-raw-device.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// eslint-disable-next-line import/order
import { test } from '../../tools/prepare-test-env-ava.js';

// eslint-disable-next-line import/order
import bundleSource from '@endo/bundle-source';
import { initSwingStore } from '@agoric/swing-store';
import { kunser } from '@agoric/kmarshal';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import process from 'process';
// eslint-disable-next-line import/order

import { handleUnhandledRejections } from './unhandledRejectionDetector.js';

// eslint-disable-next-line import/order
import { test } from '../../tools/prepare-test-env-ava.js';

// eslint-disable-next-line import/order
Expand Down
Binary file modified packages/SwingSet/test/snapshots/test-state.js.snap
Binary file not shown.
8 changes: 4 additions & 4 deletions packages/SwingSet/test/snapshots/test-xsnap-store.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ Generated by [AVA](https://avajs.dev).
{
compressSeconds: 0,
dbSaveSeconds: 0,
hash: '2e43beda6374f8435f91d4977e667933c8b90e9a7b4de9dbb2ab19e9fdcf67a1',
uncompressedSize: 807787,
hash: 'cbf3fadee8d1e42ef7875c7f2e89bffac931cae08dacca1c1851577c950256eb',
uncompressedSize: 807731,
}

> after use of harden() - sensitive to SES-shim, XS, and supervisor
{
compressSeconds: 0,
dbSaveSeconds: 0,
hash: '144c22c95948dcd386f5fe83f8ce9463d5c74475ac480261375fa0956bcfae18',
uncompressedSize: 807947,
hash: '18df29edce1bcc9e4c7e085074521d532e53078c585291bebcad9f3ae8a97d9c',
uncompressedSize: 807891,
}
Binary file modified packages/SwingSet/test/snapshots/test-xsnap-store.js.snap
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/SwingSet/test/test-activityhash-vs-start.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @ts-nocheck
// eslint-disable-next-line import/order

import { test } from '../tools/prepare-test-env-ava.js';

// eslint-disable-next-line import/order
Expand Down
1 change: 0 additions & 1 deletion packages/SwingSet/test/test-gc-actions.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// eslint-disable-next-line import/order
import { test } from '../tools/prepare-test-env-ava.js';

import { processGCActionSet } from '../src/kernel/gc-actions.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/SwingSet/test/test-gc-kernel.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @ts-nocheck
/* global WeakRef, FinalizationRegistry */
// eslint-disable-next-line import/order

import anylogger from 'anylogger';
// eslint-disable-next-line import/order
import { test } from '../tools/prepare-test-env-ava.js';
Expand Down
1 change: 0 additions & 1 deletion packages/SwingSet/test/test-metering-control.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// eslint-disable-next-line import/order
import { test } from '../tools/prepare-test-env-ava.js';

import { makeDummyMeterControl } from '../src/kernel/dummyMeterControl.js';
Expand Down
1 change: 0 additions & 1 deletion packages/SwingSet/test/test-queue-priority.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// eslint-disable-next-line no-redeclare
/* global setImmediate setTimeout */
import { test } from '../tools/prepare-test-env-ava.js';

Expand Down
2 changes: 1 addition & 1 deletion packages/SwingSet/test/test-transcript-light.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @ts-nocheck
// eslint-disable-next-line import/order

import { test } from '../tools/prepare-test-env-ava.js';
// eslint-disable-next-line import/order
import { initSwingStore } from '@agoric/swing-store';
Expand Down
1 change: 0 additions & 1 deletion packages/SwingSet/test/test-transcript.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// eslint-disable-next-line import/order
import { test } from '../tools/prepare-test-env-ava.js';
// eslint-disable-next-line import/order
import { initSwingStore } from '@agoric/swing-store';
Expand Down
1 change: 0 additions & 1 deletion packages/SwingSet/test/test-transcriptlessness.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// eslint-disable-next-line import/order
import { test } from '../tools/prepare-test-env-ava.js';

// eslint-disable-next-line import/order
Expand Down
1 change: 0 additions & 1 deletion packages/SwingSet/test/test-vattp.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// eslint-disable-next-line import/order
import { test } from '../tools/prepare-test-env-ava.js';

// eslint-disable-next-line import/order
import bundleSource from '@endo/bundle-source';
import { initSwingStore } from '@agoric/swing-store';
import { initializeSwingset, makeSwingsetController } from '../src/index.js';
Expand Down
1 change: 0 additions & 1 deletion packages/SwingSet/test/test-vpid-kernel.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ function clistVatToKernel(kernel, vatID, vpid) {
return undefined;
}

// eslint-disable-next-line no-unused-vars
function clistKernelToVat(kernel, vatID, kpid) {
for (const row of kernel.dump().kernelTable) {
const [kid0, vatID0, vid0] = row;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// eslint-disable-next-line import/order
import { test } from '../../../tools/prepare-test-env-ava.js';

// eslint-disable-next-line import/order
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// eslint-disable-next-line import/order
import { test } from '../../tools/prepare-test-env-ava.js';

// eslint-disable-next-line import/order
import { assert } from '@agoric/assert';
import { initSwingStore } from '@agoric/swing-store';
import { initializeSwingset, makeSwingsetController } from '../../src/index.js';
Expand Down
1 change: 0 additions & 1 deletion packages/SwingSet/tools/dvo-test-harness.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// eslint-disable-next-line import/order
import { test } from './prepare-test-env-ava.js';

// eslint-disable-next-line import/order
import { assert } from '@agoric/assert';
import { makeMarshal } from '@endo/marshal';
import { initSwingStore } from '@agoric/swing-store';
Expand Down
1 change: 0 additions & 1 deletion packages/agoric-cli/scripts/get-sdk-package-names.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ ps.on('close', code => {
// DO NOT EDIT - automatically generated by ${basename(
new URL(import.meta.url).pathname,
)}
/* eslint-disable comma-dangle,quotes */
// prettier-ignore
export default ${JSON.stringify(workspaces, null, 2)};
`);
Expand Down
2 changes: 1 addition & 1 deletion packages/agoric-cli/src/commands/auction.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @ts-check
/* eslint-disable func-names */

import { InvalidArgumentError } from 'commander';
import { makeRpcUtils } from '../lib/rpc.js';
import { outputActionAndHint } from '../lib/wallet.js';
Expand Down
2 changes: 0 additions & 2 deletions packages/agoric-cli/src/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ const choose = (array, randomNumber) => {
return array[index];
};

// eslint-disable-next-line jsdoc/require-returns-check
/**
* @param {unknown} connectionSpec
* @returns {asserts connectionSpec is HttpConnectionSpec}
Expand Down Expand Up @@ -117,7 +116,6 @@ const assertHttpConnectionSpec = connectionSpec => {
Fail`Expected integer "port" on "http" type connectionSpec, ${connectionSpec}`;
};

// eslint-disable-next-line jsdoc/require-returns-check
/**
* @param {unknown} connectionSpec
* @returns {asserts connectionSpec is CosmosConnectionSpec}
Expand Down
1 change: 0 additions & 1 deletion packages/agoric-cli/src/sdk-package-names.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// DO NOT EDIT - automatically generated by get-sdk-package-names.js
/* eslint-disable comma-dangle,quotes */
// prettier-ignore
export default [
"@agoric/access-token",
Expand Down
1 change: 0 additions & 1 deletion packages/agoric-cli/src/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,6 @@ export default async function startMain(progname, rawArgs, powers, opts) {
}
}
addrs[keyName] = statusOut[1].trimRight();
/* eslint-enable no-await-in-loop */
}

const genesisFile = `${serverDir}/config/genesis.json`;
Expand Down
1 change: 0 additions & 1 deletion packages/base-zone/test/test-exos.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// eslint-disable-next-line import/order
import { test } from './prepare-test-env-ava.js';

import { makeHeapZone } from '../heap.js';
Expand Down
5 changes: 2 additions & 3 deletions packages/boot/test/bootstrapTests/test-vaults-upgrade.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable jsdoc/require-param-type, @jessie.js/safe-await-separator */
/* eslint-disable @jessie.js/safe-await-separator */
/**
* @file Bootstrap test integration vaults with smart-wallet. The tests in this
* file are NOT independent; a single `test.before()` handler creates shared
Expand Down Expand Up @@ -96,9 +96,8 @@ test.serial('re-bootstrap', async t => {
const wd1 =
await oldContext.walletFactoryDriver.provideSmartWallet('agoric1a');
t.true(wd1.isNew);
// eslint-disable-next-line no-unused-vars

const assertWalletCount = (walletsProvisioned, message) => {
// eslint-disable-next-line no-unused-vars
const metrics = oldContext.readLatest('published.provisionPool.metrics');
// FIXME make wallet provisioning use the provisionPool
// disabled while wallet provisioning bypasses provisionPool
Expand Down
2 changes: 1 addition & 1 deletion packages/boot/tools/supports.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable jsdoc/require-param-type, jsdoc/require-param, @jessie.js/safe-await-separator */
/* eslint-disable jsdoc/require-param, @jessie.js/safe-await-separator */
/* global process */

import childProcessAmbient from 'child_process';
Expand Down
1 change: 0 additions & 1 deletion packages/casting/src/makeHttpClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ export const makeHttpClient = (url, fetch) => {
method: 'POST',
body: request ? JSON.stringify(request) : undefined,
headers: {
// eslint-disable-next-line @typescript-eslint/naming-convention
'Content-Type': 'application/json',
...headers,
},
Expand Down
4 changes: 2 additions & 2 deletions packages/casting/test/test-mvp.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @ts-nocheck
// eslint-disable-next-line import/order

import './lockdown.js';

import { makeMarshal } from '@endo/marshal';
Expand Down Expand Up @@ -201,7 +201,7 @@ test('yields error on bad capdata without terminating', async t => {
const castingSpec = makeCastingSpec(':mailbox.agoric1foobarbaz');
const follower = await makeFollower(castingSpec, leader, so);
let i = 0;
// eslint-disable-next-line no-unreachable-loop

for await (const { value, error } of iterateEach(follower)) {
if (i === 0) {
t.log(`value from follower, should be undefined:`, value);
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@jessie.js/eslint-plugin": "^0.4.0",
"@typescript-eslint/eslint-plugin": "^6.20.0",
"@typescript-eslint/parser": "^6.20.0",
"eslint": "^8.47.0",
"eslint": "^8.57.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-plugin-github": "^4.10.0",
"eslint-config-jessie": "^0.0.6",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable ava/assertion-arguments -- the standard diff is unreadable */
// eslint-disable-next-line import/no-extraneous-dependencies

import test from 'ava';
import { buildVatController, buildKernelBundles } from '@agoric/swingset-vat';
import bundleSource from '@endo/bundle-source';
Expand Down
1 change: 0 additions & 1 deletion packages/governance/tools/puppetContractGovernor.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import '../src/types-ambient.js';
import { E } from '@endo/eventual-send';
import { Far } from '@endo/marshal';

// eslint-disable-next-line no-unused-vars
import { Fail } from '@agoric/assert';
// eslint-disable-next-line no-unused-vars -- used by typedef
import { CONTRACT_ELECTORATE } from '../src/contractGovernance/governParam.js';
Expand Down
4 changes: 2 additions & 2 deletions packages/inter-protocol/src/proposals/core-proposal.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { ECON_COMMITTEE_MANIFEST } from './startEconCommittee.js';
export * from './econ-behaviors.js';
// @ts-expect-error Module './econ-behaviors.js' has already exported a member
// named 'EconomyBootstrapPowers'.
export * from './startPSM.js'; // eslint-disable-line import/export
export * from './startEconCommittee.js'; // eslint-disable-line import/export
export * from './startPSM.js';
export * from './startEconCommittee.js';

// XXX all the startInstance() should use startUpgradable()
// or startGovernedUpgradeable() but that would
Expand Down
1 change: 0 additions & 1 deletion packages/inter-protocol/src/vaultFactory/vault.js
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,6 @@ export const prepareVault = (baggage, makeRecorderKit, zcf) => {
helper.assertCloseable();
seat.exit();

// eslint-disable-next-line no-use-before-define
const vaultKit = makeVaultKit(self, state.storageNode);
state.outerUpdater = vaultKit.vaultUpdater;
helper.updateUiState();
Expand Down
1 change: 0 additions & 1 deletion packages/inter-protocol/src/vaultFactory/vaultManager.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable consistent-return */
/**
* @file Vault Manager object manages vault-based debts for a collateral type.
*
Expand Down
Loading

0 comments on commit 5d5ee65

Please sign in to comment.