From 5211007ff6f2c361d748006c427201abd4d04c70 Mon Sep 17 00:00:00 2001 From: 0xPatrick Date: Wed, 3 Jan 2024 16:17:38 -0500 Subject: [PATCH 1/5] fix(contract): yarn lint not configured correctly - adds missing @agoric/eslint-config dependency - tells parser to use ecmaVersion 2021 so bigint is recognized --- contract/package.json | 6 ++++++ yarn.lock | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/contract/package.json b/contract/package.json index bee629c..46d9e10 100644 --- a/contract/package.json +++ b/contract/package.json @@ -22,8 +22,10 @@ "agoric": "^0.21.2-u12.0", "@agoric/deploy-script-support": "^0.10.4-u12.0", "@endo/bundle-source": "^2.8.0", + "@agoric/eslint-config": "dev", "@endo/eslint-plugin": "^0.5.2", "@endo/init": "^0.5.60", + "@endo/promise-kit": "0.2.56", "@endo/ses-ava": "^0.2.44", "@jessie.js/eslint-plugin": "^0.4.0", "@typescript-eslint/eslint-plugin": "^6.7.0", @@ -73,6 +75,10 @@ }, "homepage": "https://github.com/agoric-labs/dapp-join-game#readme", "eslintConfig": { + "parserOptions": { + "sourceType": "module", + "ecmaVersion": 2021 + }, "extends": [ "@agoric" ] diff --git a/yarn.lock b/yarn.lock index 7aabdca..ae64176 100644 --- a/yarn.lock +++ b/yarn.lock @@ -167,6 +167,11 @@ "@endo/nat" "4.1.27" "@endo/promise-kit" "0.2.56" +"@agoric/eslint-config@dev": + version "0.4.1-dev-92855b2.0" + resolved "https://registry.yarnpkg.com/@agoric/eslint-config/-/eslint-config-0.4.1-dev-92855b2.0.tgz#785047361da1af5956c0555d94867dc2caf837b8" + integrity sha512-tBJnlh4Td/VtMlSzMCRRimwFY7OIIWKmBorjuhDlVbApnoLZGGqQVe6FkbjE+b8S3kJnfoGShAO/jzUxXekjJw== + "@agoric/eventual-send@^0.14.1": version "0.14.1" resolved "https://registry.yarnpkg.com/@agoric/eventual-send/-/eventual-send-0.14.1.tgz#b414888bed67cf003a61bd22da30a70f79b8f9dc" From 7dd5c9af2642958ac6ab0b1dfc9c81152cc46e98 Mon Sep 17 00:00:00 2001 From: 0xPatrick Date: Wed, 3 Jan 2024 16:19:41 -0500 Subject: [PATCH 2/5] feat(ci): add github workflow for lint and test --- .github/workflows/pr.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/pr.yml diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..46c959f --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,21 @@ +name: Lint and Test + +on: + pull_request: + +jobs: + all: + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + - name: Use Node.js 18.8.x + uses: actions/setup-node@v3 + with: + node-version: '18.8.x' + - name: yarn install + run: yarn + - name: yarn lint + run: yarn lint + - name: yarn test + run: yarn test From a8a339e498bdcfb3d190077cc7057883c2c51316 Mon Sep 17 00:00:00 2001 From: 0xPatrick Date: Wed, 3 Jan 2024 16:19:56 -0500 Subject: [PATCH 3/5] fix(contract): run eslint --fix --- contract/test/mintStable.js | 2 +- contract/test/test-contract.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/contract/test/mintStable.js b/contract/test/mintStable.js index 5b235cb..78156fc 100644 --- a/contract/test/mintStable.js +++ b/contract/test/mintStable.js @@ -27,7 +27,7 @@ const centralSupplyPath = myRequire.resolve( * just for this purpose. Each time we want to mint a fee/stable token payment, * we make an instance of of the `centralSupply` contract. * - * @param {Object} powers + * @param {object} powers * @param {ERef} powers.feeMintAccess for minting IST * @param {ERef} powers.zoe for starting the `centralSupply` contract * @param {BundleCache} powers.bundleCache for bundling the `centralSupply` contract diff --git a/contract/test/test-contract.js b/contract/test/test-contract.js index 4fad7a5..44e9581 100644 --- a/contract/test/test-contract.js +++ b/contract/test/test-contract.js @@ -80,6 +80,7 @@ test('Start the contract', async t => { * @param {ZoeService} zoe * @param {ERef} instance * @param {Purse} purse + * @param {string[]} choices */ const alice = async ( t, From 1a734ac66bd12dd583c2c5bcb56bf96422ef3438 Mon Sep 17 00:00:00 2001 From: 0xPatrick Date: Wed, 3 Jan 2024 16:45:28 -0500 Subject: [PATCH 4/5] chore(contract): update package.json lint scripts - remove explicit lin-jessie command, as @agoric/eslint-config extends eslint-config-jessie - use lint:fix in favor of lint-fix --- contract/package.json | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/contract/package.json b/contract/package.json index 46d9e10..2066c08 100644 --- a/contract/package.json +++ b/contract/package.json @@ -13,10 +13,8 @@ "start": "yarn docker:make clean start-contract print-key", "build": "exit 0", "test": "ava --verbose", - "lint": "eslint '**/*.{js,jsx}'", - "lint-fix": "eslint --fix '**/*.{js,jsx}'", - "lint-fix-jessie": "eslint -c '.eslintrc-jessie.js' --fix '**/*.{js,jsx}'", - "lint-jessie": "eslint -c '.eslintrc-jessie.js' '**/*.{js,jsx}'" + "lint": "eslint '**/*.js'", + "lint:fix": "eslint --fix '**/*.js'" }, "devDependencies": { "agoric": "^0.21.2-u12.0", From fccae72fed0f1a6c5286bd6f587f1b50e4a77480 Mon Sep 17 00:00:00 2001 From: 0xPatrick Date: Wed, 3 Jan 2024 16:48:26 -0500 Subject: [PATCH 5/5] docs(ci): document reason for node 18.18.x --- .github/workflows/pr.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 46c959f..933ccbb 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -12,6 +12,7 @@ jobs: - name: Use Node.js 18.8.x uses: actions/setup-node@v3 with: + # use node 18.8.x until Agoric/agoric-sdk#8636 node-version: '18.8.x' - name: yarn install run: yarn