Skip to content

Commit

Permalink
chore(multichain-testing): adapt to eslint v9 flat config
Browse files Browse the repository at this point in the history
  • Loading branch information
iomekam committed Jan 23, 2025
1 parent 78b053b commit 6bd3574
Show file tree
Hide file tree
Showing 6 changed files with 190 additions and 153 deletions.
46 changes: 46 additions & 0 deletions multichain-testing/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import typescriptEslint from '@typescript-eslint/eslint-plugin';
import globals from 'globals';
import tsParser from '@typescript-eslint/parser';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});

export default [
...compat.extends(
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
),
{
plugins: {
'@typescript-eslint': typescriptEslint,
},

languageOptions: {
globals: {
...globals.node,
},

parser: tsParser,
},

rules: {
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
},
},
];
28 changes: 2 additions & 26 deletions multichain-testing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"build": "exit 0",
"lint": "yarn tsc && yarn eslint .",
"lint-fix": "yarn lint:eslint --fix",
"lint-fix": "yarn eslint . --fix",
"test": "echo 'Run specific test suites:\nyarn test:main (needs `make start`)\nyarn test:fast-usdc (needs `make start FILE=config.fusdc.yaml`)'",
"test:main": "ava --config ava.main.config.js",
"test:fast-usdc": "ava --config ava.fusdc.config.js",
Expand All @@ -32,7 +32,7 @@
"@typescript-eslint/eslint-plugin": "^8.17.0",
"@typescript-eslint/parser": "^8.17.0",
"ava": "^6.2.0",
"eslint": "^8.56.0",
"eslint": "^9.0.0",
"eslint-config-prettier": "^9.1.0",
"execa": "9.1.0",
"fs-extra": "^11.2.0",
Expand Down Expand Up @@ -91,29 +91,5 @@
"@agoric/zoe": "portal:../packages/zoe",
"@agoric/zone": "portal:../packages/zone"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"rules": {
"@typescript-eslint/no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_"
}
]
}
},
"license": "Apache-2.0"
}
1 change: 0 additions & 1 deletion multichain-testing/scripts/fast-usdc-tool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ const main = async () => {
instancePath: [contractName],
callPipe: [['makeDepositInvitation']],
},
// @ts-expect-error 'NatAmount' vs 'AnyAmount'
proposal,
});
};
Expand Down
3 changes: 1 addition & 2 deletions multichain-testing/tools/e2e-tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ const trace = makeTracer('E2ET');
const BLD = '000000ubld';

export const txAbbr = tx => {
// eslint-disable-next-line camelcase
const { txhash, code, height, gas_used } = tx;
// eslint-disable-next-line camelcase

return { txhash, code, height, gas_used };
};

Expand Down
8 changes: 7 additions & 1 deletion multichain-testing/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"allowImportingTsExtensions": true,
"noUnusedLocals": false,
"noUnusedParameters": false
},
"include": [
"src",
"tools",
"test"
"test",
"scripts"
]
}
Loading

0 comments on commit 6bd3574

Please sign in to comment.