Skip to content

Commit

Permalink
Merge pull request #8058 from Agoric/4620-ts-project
Browse files Browse the repository at this point in the history
restore types linting
  • Loading branch information
turadg authored Jul 17, 2023
2 parents bd1190d + 903fef7 commit 6f740a4
Show file tree
Hide file tree
Showing 134 changed files with 304 additions and 78 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: lintTypes
? {
// this is not yet compatible with eslint lsp so it's conditioned on AGORIC_ESLINT_TYPES
EXPERIMENTAL_useProjectService: true,
sourceType: 'module',
project: [
'./packages/*/jsconfig.json',
Expand Down
2 changes: 1 addition & 1 deletion golang/cosmos/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"postpack": "git clean -f git-revision.txt",
"build": "exit 0",
"lint-fix": "yarn lint:eslint --fix",
"lint": "eslint '**/*.{cjs,js}'"
"lint": "exit 0"
},
"dependencies": {
"bindings": "^1.2.1",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"@jessie.js/eslint-plugin": "^0.4.0",
"@types/express": "^4.17.17",
"@types/node": "^16.13.0",
"@typescript-eslint/eslint-plugin": "^5.61.0",
"@typescript-eslint/parser": "^5.61.0",
"@typescript-eslint/eslint-plugin": "^6.1.0",
"@typescript-eslint/parser": "^6.1.0",
"ava": "^5.3.0",
"c8": "^7.13.0",
"conventional-changelog-conventionalcommits": "^4.6.0",
Expand Down
1 change: 1 addition & 0 deletions packages/ERTP/jsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"extends": "../../tsconfig.json",
"include": [
"exported.js",
"src/**/*.js",
"src/**/*.ts",
"test"
Expand Down
7 changes: 5 additions & 2 deletions packages/SwingSet/jsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
{
"extends": "../../tsconfig.json",
"include": [
"exported.js",
"demo/**/*.js",
"lib/**/*.js",
"misc-tools/**/*.js",
"src/**/*.js",
"src/**/*.ts",
// "test",
"test",
"tools",
],
]
}
1 change: 1 addition & 0 deletions packages/SwingSet/misc-tools/db-delete.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env node
// @ts-nocheck
import '@endo/init';
import process from 'process';
import { openSwingStore } from '@agoric/swing-store';
Expand Down
1 change: 1 addition & 0 deletions packages/SwingSet/misc-tools/db-dump.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
/* eslint-disable */
import '@endo/init';
import process from 'process';
Expand Down
1 change: 1 addition & 0 deletions packages/SwingSet/misc-tools/db-get.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env node
// @ts-nocheck
import '@endo/init';
import process from 'process';
import { openSwingStore } from '@agoric/swing-store';
Expand Down
1 change: 1 addition & 0 deletions packages/SwingSet/misc-tools/db-set.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env node
// @ts-nocheck
import '@endo/init';
import process from 'process';
import { openSwingStore } from '@agoric/swing-store';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
import fs from 'fs';
import zlib from 'zlib';
import readline from 'readline';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @ts-check
// @ts-nocheck

import '@endo/init';
import process from 'process';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
import fs from 'fs';
import zlib from 'zlib';
import readline from 'readline';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
import fs from 'fs';
import zlib from 'zlib';
import readline from 'readline';
Expand Down
2 changes: 1 addition & 1 deletion packages/SwingSet/misc-tools/extract-xs-snapshot.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @ts-check
// @ts-nocheck

import '@endo/init';
import process from 'process';
Expand Down
1 change: 1 addition & 0 deletions packages/SwingSet/misc-tools/ingest-xs-snapshot.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
/* eslint-disable */
// import '@endo/init';
// import { E } from '@endo/far';
Expand Down
1 change: 1 addition & 0 deletions packages/SwingSet/misc-tools/measure-metering/measure.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
// run as `node tools/measure-metering/measure.js`

// eslint-disable-next-line import/order
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
/* eslint-disable import/no-extraneous-dependencies,no-unused-vars,no-empty-function */
import { Far, E } from '@endo/far';
import vaultFactoryBundle from '@agoric/inter-protocol/bundles/bundle-vaultFactory.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
/* eslint-disable import/no-extraneous-dependencies,no-unused-vars,no-empty-function */
import { Far } from '@endo/far';
// XXX cyclic dependency; TODO move this tool out of swingset-vat
Expand Down
1 change: 1 addition & 0 deletions packages/SwingSet/misc-tools/replace-bundle.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env node
// @ts-nocheck

import '@endo/init';
import process from 'process';
Expand Down
2 changes: 2 additions & 0 deletions packages/SwingSet/misc-tools/replay-transcript.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,13 +332,15 @@ async function replay(transcriptFile) {
throw Error(`unhandled worker type ${worker}`);
}

// @ts-expect-error missing symbol
/** @type {Partial<Record<ReturnType<typeof getResultKind>, Map<string, number[]>>>} */
let syscallResults = {};

const analyzeSyscallResults = () => {
const numWorkers = workers.length;
let divergent = false;
for (const [kind, kindSummary] of Object.entries(syscallResults)) {
// @ts-expect-error due to missing symbol above, but also `syscallResults` is never populated
for (const [syscallKey, workerList] of kindSummary.entries()) {
if (workerList.length !== numWorkers) {
console.error(
Expand Down
1 change: 1 addition & 0 deletions packages/SwingSet/misc-tools/vat-stats.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
/* eslint-disable */
import '@endo/init';
import process from 'process';
Expand Down
3 changes: 2 additions & 1 deletion packages/SwingSet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"devDependencies": {
"@types/better-sqlite3": "^7.5.0",
"@types/microtime": "^2.1.0",
"@types/tmp": "^0.2.0"
"@types/tmp": "^0.2.0",
"@types/yargs-parser": "^21.0.0"
},
"dependencies": {
"@agoric/assert": "^0.6.0",
Expand Down
1 change: 1 addition & 0 deletions packages/SwingSet/test/bundling/nonvat-importable.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
/* global big globalThis */

export function runTheCheck(world) {
Expand Down
1 change: 1 addition & 0 deletions packages/SwingSet/test/bundling/nonvat-install.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
/* global big globalThis */

export function runTheCheck(world) {
Expand Down
1 change: 1 addition & 0 deletions packages/SwingSet/test/bundling/test-bundles-controller.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
// eslint-disable-next-line import/order
import { test } from '../../tools/prepare-test-env-ava.js';

Expand Down
1 change: 1 addition & 0 deletions packages/SwingSet/test/bundling/test-bundles.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
// eslint-disable-next-line import/order
import { test } from '../../tools/prepare-test-env-ava.js';

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

Expand Down
1 change: 1 addition & 0 deletions packages/SwingSet/test/commsVatDriver.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
import { assert, Fail } from '@agoric/assert';
import buildCommsDispatch from '../src/vats/comms/index.js';
import { debugState } from '../src/vats/comms/dispatch.js';
Expand Down
1 change: 1 addition & 0 deletions packages/SwingSet/test/device-hooks/test-device-hooks.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
/* eslint-disable no-lone-blocks */
// eslint-disable-next-line import/order
import { test } from '../../tools/prepare-test-env-ava.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @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: 1 addition & 0 deletions packages/SwingSet/test/device-plugin/test-device.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
import { test } from '../../tools/prepare-test-env-ava.js';

// eslint-disable-next-line import/order
Expand Down
1 change: 1 addition & 0 deletions packages/SwingSet/test/devices/bootstrap-raw.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
import { Far } from '@endo/far';
import { makePromiseKit } from '@endo/promise-kit';

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

Expand Down
1 change: 1 addition & 0 deletions packages/SwingSet/test/devices/test-raw-device.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
// eslint-disable-next-line import/order
import { test } from '../../tools/prepare-test-env-ava.js';

Expand Down
1 change: 1 addition & 0 deletions packages/SwingSet/test/gc/bootstrap.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
import { Far, E } from '@endo/far';

export function buildRootObject() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
// eslint-disable-next-line import/order
import { test } from '../../tools/prepare-test-env-ava.js';

Expand Down
1 change: 1 addition & 0 deletions packages/SwingSet/test/promise-watcher/vat-upton.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
import { Far, E } from '@endo/far';
import { initEmpty } from '@agoric/store';
import { makePromiseKit } from '@endo/promise-kit';
Expand Down
1 change: 1 addition & 0 deletions packages/SwingSet/test/run-policy/test-run-policy.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
import { test } from '../../tools/prepare-test-env-ava.js';

// eslint-disable-next-line import/order
Expand Down
1 change: 1 addition & 0 deletions packages/SwingSet/test/test-abandon-export.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
/* eslint-disable import/order */
import { test } from '../tools/prepare-test-env-ava.js';

Expand Down
1 change: 1 addition & 0 deletions packages/SwingSet/test/test-activityhash-vs-start.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
// eslint-disable-next-line import/order
import { test } from '../tools/prepare-test-env-ava.js';

Expand Down
1 change: 1 addition & 0 deletions packages/SwingSet/test/test-clist.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
import { test } from '../tools/prepare-test-env-ava.js';

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

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

Expand Down
1 change: 1 addition & 0 deletions packages/SwingSet/test/test-device-bridge.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
import { test } from '../tools/prepare-test-env-ava.js';

// eslint-disable-next-line import/order
Expand Down
1 change: 1 addition & 0 deletions packages/SwingSet/test/test-gc-and-finalize.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
/* global FinalizationRegistry WeakRef */
// eslint-disable-next-line import/order
import { test } from '../tools/prepare-test-env-ava.js';
Expand Down
1 change: 1 addition & 0 deletions packages/SwingSet/test/test-gc-kernel.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
/* global WeakRef, FinalizationRegistry */
// eslint-disable-next-line import/order
import anylogger from 'anylogger';
Expand Down
1 change: 1 addition & 0 deletions packages/SwingSet/test/test-kernel.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
// eslint-disable-next-line import/order
import { test } from '../tools/prepare-test-env-ava.js';

Expand Down
1 change: 1 addition & 0 deletions packages/SwingSet/test/test-message-patterns-comms.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
/* eslint no-await-in-loop: "off" */
/* eslint dot-notation: "off" */
/* eslint object-shorthand: "off" */
Expand Down
1 change: 1 addition & 0 deletions packages/SwingSet/test/test-message-patterns-local.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
/* eslint no-await-in-loop: "off" */
/* eslint dot-notation: "off" */
/* eslint object-shorthand: "off" */
Expand Down
1 change: 1 addition & 0 deletions packages/SwingSet/test/test-network.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
// eslint-disable-next-line import/order
import { test } from '../tools/prepare-test-env-ava.js';

Expand Down
1 change: 1 addition & 0 deletions packages/SwingSet/test/test-promises.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
import { test } from '../tools/prepare-test-env-ava.js';

// eslint-disable-next-line import/order
Expand Down
1 change: 1 addition & 0 deletions packages/SwingSet/test/test-state.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
/* eslint-disable no-useless-concat */
// eslint-disable-next-line import/order
import { test } from '../tools/prepare-test-env-ava.js';
Expand Down
1 change: 1 addition & 0 deletions packages/SwingSet/test/test-syscall-failure.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
import { test } from '../tools/prepare-test-env-ava.js';

// eslint-disable-next-line import/order
Expand Down
1 change: 1 addition & 0 deletions packages/SwingSet/test/test-timer-device.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
import { test } from '../tools/prepare-test-env-ava.js';

// eslint-disable-next-line import/order
Expand Down
1 change: 1 addition & 0 deletions packages/SwingSet/test/test-transcript-light.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @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: 1 addition & 0 deletions packages/SwingSet/test/test-vat-env.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
import { test, VatData } from '../tools/prepare-test-env-ava.js';

// eslint-disable-next-line import/order
Expand Down
1 change: 1 addition & 0 deletions packages/SwingSet/test/test-vat-timer.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
// eslint-disable-next-line import/order
import { test } from '../tools/prepare-test-env-ava.js';

Expand Down
1 change: 1 addition & 0 deletions packages/SwingSet/test/test-vpid-kernel.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
/* global WeakRef, FinalizationRegistry */
// eslint-disable-next-line import/order
import { test } from '../tools/prepare-test-env-ava.js';
Expand Down
1 change: 1 addition & 0 deletions packages/SwingSet/test/test-xsnap-metering.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
// eslint-disable-next-line import/order
import { test } from '../tools/prepare-test-env-ava.js';

Expand Down
1 change: 1 addition & 0 deletions packages/SwingSet/test/test-xsnap-store.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
/* global globalThis */
import '@endo/init/debug.js';

Expand Down
1 change: 1 addition & 0 deletions packages/SwingSet/test/timer-device/device-timer.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
import setup from '../../src/devices/timer/device-timer.js';

export { setup };
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
import test from 'ava';
import '@endo/init/debug.js';
import tmp from 'tmp';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
import test from 'ava';
import '@endo/init/debug.js';
import { initSwingStore } from '@agoric/swing-store';
Expand Down
1 change: 1 addition & 0 deletions packages/SwingSet/test/upgrade/test-upgrade-replay.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
// eslint-disable-next-line import/order
import { test } from '../../tools/prepare-test-env-ava.js';

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

Expand Down
1 change: 1 addition & 0 deletions packages/SwingSet/test/vat-admin/broken-module-vat.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
// eslint-disable-next-line no-undef
missing({});

Expand Down
1 change: 1 addition & 0 deletions packages/SwingSet/test/vat-admin/broken-root-vat.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
export function buildRootObject() {
// eslint-disable-next-line no-undef
return missing({});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @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
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @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: 1 addition & 0 deletions packages/SwingSet/test/vat-admin/test-create-vat.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @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
Loading

0 comments on commit 6f740a4

Please sign in to comment.