From 6ed331ffcb48ff10d4bc3fbe844382db9fd5769c Mon Sep 17 00:00:00 2001 From: g1nt0ki <99907941+g1nt0ki@users.noreply.github.com> Date: Sat, 18 Oct 2025 23:09:52 +0200 Subject: [PATCH] test pnpn cache (#16743) --- .eslintrc.js | 21 --------------------- .github/workflows/test.yml | 1 - eslint.config.js | 16 ++++++++++++++++ package.json | 4 ++-- projects/blacksail/index.js | 4 ++-- projects/filliquid/index.js | 3 --- projects/helper/balancer.js | 1 - projects/helper/sumTokens.js | 1 - projects/helper/utils/pact.js | 2 +- projects/kpk/index.js | 1 - projects/levana/index.js | 1 - projects/spot/index.js | 2 +- projects/sushiswap-bentobox/helper.js | 1 - tsconfig.json | 21 --------------------- utils/testInteractive.js | 2 +- 15 files changed, 23 insertions(+), 58 deletions(-) delete mode 100644 .eslintrc.js create mode 100644 eslint.config.js delete mode 100644 tsconfig.json diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index bb9d6c851..000000000 --- a/.eslintrc.js +++ /dev/null @@ -1,21 +0,0 @@ -module.exports = { - "env": { - "node": true, - "commonjs": true, - "es2021": true - }, - "extends": "eslint:recommended", - "overrides": [ - ], - "parserOptions": { - "ecmaVersion": "latest" - }, - ignorePatterns: ['projects/test/*'], - "rules": { - "no-case-declarations": "off", - "no-unused-vars": "off", - "no-useless-escape": "warn", - "no-prototype-builtins": "off", - "no-unreachable": "off", - } -} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7f9ecb1f5..32af27723 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -72,5 +72,4 @@ jobs: - name: Run ESLint run: | - npm ci npm run lint diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 000000000..9603b9836 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,16 @@ +module.exports = [ + { + files: ["**/*.js"], + ignores: ["projects/test/*"], + languageOptions: { + ecmaVersion: "latest", + }, + rules: { + "no-case-declarations": "off", + "no-unused-vars": "off", + "no-useless-escape": "warn", + "no-prototype-builtins": "off", + "no-unreachable": "off", + } + } +]; \ No newline at end of file diff --git a/package.json b/package.json index 8edc30490..2fb9c218d 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,8 @@ "weeklyChanges": "git pull && git diff $(git log -1 --before=@{7.days.ago} --format=%H) --stat | grep -E \"projects/\" | cut -d / -f 2 | cut -d \" \" -f 1 | uniq | wc -l", "dev": "babel-watch curve.js", "build": "node scripts/buildImports.js", - "lint": "eslint -c .eslintrc.js .", - "eslint:github-action": "eslint -c .eslintrc.js .", + "lint": "eslint -c eslint.config.js .", + "eslint:github-action": "eslint -c eslint.config.js .", "test-interactive": "node utils/testInteractive", "tvl": "cd utils;npm i; cd ..; node utils/testInteractive", "treasury": "cd utils;npm i; cd ..; node utils/testInteractive treasury", diff --git a/projects/blacksail/index.js b/projects/blacksail/index.js index cf321e5d8..0e4c8713f 100644 --- a/projects/blacksail/index.js +++ b/projects/blacksail/index.js @@ -4,13 +4,13 @@ const { getEnv } = require('../helper/env') const { sumUnknownTokens } = require('../helper/unknownTokens') async function fetcher() { - const { data: { yield }} = await get('https://api.blacksail.finance/stats', { + const { data} = await get('https://api.blacksail.finance/stats', { headers: { 'x-api-key': getEnv('BLACKSAIL_API_KEY'), 'Content-Type': 'application/json' } }); - return Object.values(yield).map((i) => i.strat_address).filter(i => i) + return Object.values(data.yield).map((i) => i.strat_address).filter(i => i) } async function tvl(api) { diff --git a/projects/filliquid/index.js b/projects/filliquid/index.js index a0fa8b3d7..d76b9607e 100644 --- a/projects/filliquid/index.js +++ b/projects/filliquid/index.js @@ -1,5 +1,3 @@ -/* eslint-disable no-async-promise-executor */ -const sdk = require('@defillama/sdk'); const ADDRESSES = require('../helper/coreAssets.json') const static_contract = "0xA25F892cF2731ba89b88750423Fc618De0959C43"; const fil_fig_stake_contract = "0xD44bfE4523f1B2703DDE9C7dBc010Ad39EF668f7"; @@ -35,4 +33,3 @@ module.exports = { staking:(api) => getFigStake(api, bsc_fig_stake_contract, BSC_FIG_TOKEN) } }; -/* eslint-enable no-async-promise-executor */ diff --git a/projects/helper/balancer.js b/projects/helper/balancer.js index b0b1e1308..aeb5514fd 100644 --- a/projects/helper/balancer.js +++ b/projects/helper/balancer.js @@ -119,7 +119,6 @@ function v3Tvl( if (!tokenBalances.length) throw new Error("null value of tokens"); const blSet = new Set([...blacklistedTokens, ...pools].map((s) => s.toLowerCase())); - // eslint-disable-next-line no-const-assign tokenBalances = tokenBalances.filter(([t]) => !blSet.has(String(t).toLowerCase())); await api.addTokens(tokenBalances); diff --git a/projects/helper/sumTokens.js b/projects/helper/sumTokens.js index e7cf0c8d7..7320cb0b3 100644 --- a/projects/helper/sumTokens.js +++ b/projects/helper/sumTokens.js @@ -79,7 +79,6 @@ async function sumTokens(options) { const evmAddressExceptions = new Set(['tron', 'xdc']) const nonEvmOwnerFound = !evmAddressExceptions.has(chain) && owners.some(o => !o.startsWith('0x')) const isAltEvm = altEVMHelper[chain] && nonEvmOwnerFound - console.log('chain:', chain, 'isAltEvm:', isAltEvm, 'nonEvmOwnerFound:', nonEvmOwnerFound) if (!ibcChains.includes(chain) && !helpers[chain] && !specialChains.includes(chain) && !isAltEvm) { if (nonEvmOwnerFound) throw new Error('chain handler missing: ' + chain) diff --git a/projects/helper/utils/pact.js b/projects/helper/utils/pact.js index 2c9de0da5..33db6e8b4 100644 --- a/projects/helper/utils/pact.js +++ b/projects/helper/utils/pact.js @@ -101,7 +101,7 @@ const b64url = (function () { // initialize result and counters var bc = 0, bs, buffer, idx = 0, output = ''; // get next character - buffer = str.charAt(idx++); // eslint-disable-line no-cond-assign + buffer = str.charAt(idx++); // character found in table? initialize bit storage and add its ascii value; ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer, // and if not first of each 4 characters, diff --git a/projects/kpk/index.js b/projects/kpk/index.js index 2157d2180..084658e34 100644 --- a/projects/kpk/index.js +++ b/projects/kpk/index.js @@ -47,7 +47,6 @@ async function getGearboxV31Collateral(api, marketConfigurator, pageSize = 1e3) // page through credit accounts for each CM for (const cm of creditManagers) { let offset = 0 - // eslint-disable-next-line no-constant-condition while (true) { const accounts = await api.call({ abi: GearboxCompressorABI.getCreditAccounts, diff --git a/projects/levana/index.js b/projects/levana/index.js index c9bcacd67..97e47ccbe 100644 --- a/projects/levana/index.js +++ b/projects/levana/index.js @@ -31,7 +31,6 @@ async function tvl(api) { async function getMarketIds(chain, factory) { const market_ids = []; - // eslint-disable-next-line no-constant-condition while(true) { const resp = await queryContract({ contract: factory, diff --git a/projects/spot/index.js b/projects/spot/index.js index 53b68070b..277fa83b5 100644 --- a/projects/spot/index.js +++ b/projects/spot/index.js @@ -15,4 +15,4 @@ module.exports = { return api.sumTokens({ tokens: ["0xd46ba6d942050d489dbd938a2c909a5d5039a161"], owners: [...bonds, "0x82A91a0D599A45d8E9Af781D67f695d7C72869Bd"] }) } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/projects/sushiswap-bentobox/helper.js b/projects/sushiswap-bentobox/helper.js index 501944edf..f6af281c8 100644 --- a/projects/sushiswap-bentobox/helper.js +++ b/projects/sushiswap-bentobox/helper.js @@ -201,7 +201,6 @@ async function fetchAllTokens(subgraph, query, block, type) { const isKashi = type === 'kashi'; const key = isKashi ? 'kashiPairs' : 'tokens'; - // eslint-disable-next-line no-constant-condition while (true) { const result = await request(subgraph, query, { id: lastId, block }); const tokens = result[key] || []; diff --git a/tsconfig.json b/tsconfig.json deleted file mode 100644 index 682d025ac..000000000 --- a/tsconfig.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - // This is an alias to @tsconfig/node16: https://github.com/tsconfig/bases - "extends": "ts-node/node16/tsconfig.json", - // Most ts-node options can be specified here using their programmatic names. - "ts-node": { - // It is faster to skip typechecking. - // Remove if you want ts-node to do typechecking. - "transpileOnly": true, - "files": true, - "compilerOptions": { - // compilerOptions specified here will override those declared below, - // but *only* in ts-node. Useful if you want ts-node and tsc to use - // different options with a single tsconfig.json. - } - }, - "compilerOptions": { - "noImplicitAny": false, - "strictNullChecks": false, - "typeRoots": ["./typings/", "./node_modules/@types/"] - } -} \ No newline at end of file diff --git a/utils/testInteractive.js b/utils/testInteractive.js index 8bdb1f46d..29ad4d5e8 100644 --- a/utils/testInteractive.js +++ b/utils/testInteractive.js @@ -38,7 +38,7 @@ async function run() { ]) adapterPath = response.adapterPath - while (true) { // eslint-disable-line + while (true) { adapterPrompt.default = adapterPath await runAdapter(adapterPath, true) const answer = await inquirer.prompt([adapterPrompt])