fix: normalize token address casing in market data retrieval - #809
fix: normalize token address casing in market data retrieval#809kvhnuke wants to merge 2 commits into
Conversation
|
💼 Build Files |
WalkthroughThis change normalizes Ethereum contract addresses in transaction decoding and updates runtime and development dependency versions across the monorepo. ChangesDecoder address normalization and dependency updates
Estimated code review effort: 2 (Simple) | ~15 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/extension/src/providers/ethereum/libs/transaction/decoder.ts (1)
62-73: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueLGTM on lowercase market-data lookup, minor duplication.
Lowercasing the contract address for
getMarketInfoByContractsand the subsequentmarketInfolookups correctly addresses the casing mismatch.tx.to!.toLowerCase()is computed 4 times though; extracting it once would avoid the repeated work and improve readability.♻️ Optional refactor
+ const lowerTo = tx.to!.toLowerCase(); await marketData .getMarketInfoByContracts( - [tx.to!.toLowerCase()], + [lowerTo], network.coingeckoPlatform!, ) .then(marketInfo => { - if (marketInfo[tx.to!.toLowerCase()]) { + if (marketInfo[lowerTo]) { currentPriceUSD = - marketInfo[tx.to!.toLowerCase()]!.current_price ?? 0; - CGToken = marketInfo[tx.to!.toLowerCase()]!.id; + marketInfo[lowerTo]!.current_price ?? 0; + CGToken = marketInfo[lowerTo]!.id; } });🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/extension/src/providers/ethereum/libs/transaction/decoder.ts` around lines 62 - 73, In the transaction decoder logic, the lowercase contract address is computed repeatedly via tx.to!.toLowerCase() inside the market-data lookup and response access, which adds unnecessary duplication. Refactor the flow in the decoder.ts handler by extracting that value once into a local variable and reusing it for getMarketInfoByContracts and the marketInfo indexing, keeping the existing behavior in the decoder logic unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/extension/src/providers/ethereum/libs/transaction/decoder.ts`:
- Line 89: The DecodedTx mapping in decoder.ts is still calling toLowerCase on
tx.to via a non-null assertion, which will crash for contract-creation
transactions where tx.to is absent. Update the decoding logic around the tx.to
assignment so it safely handles undefined/null values, preserving the existing
behavior for contract creation by leaving toAddress unset or passing through the
missing value without invoking string methods.
---
Nitpick comments:
In `@packages/extension/src/providers/ethereum/libs/transaction/decoder.ts`:
- Around line 62-73: In the transaction decoder logic, the lowercase contract
address is computed repeatedly via tx.to!.toLowerCase() inside the market-data
lookup and response access, which adds unnecessary duplication. Refactor the
flow in the decoder.ts handler by extracting that value once into a local
variable and reusing it for getMarketInfoByContracts and the marketInfo
indexing, keeping the existing behavior in the decoder logic unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: b55cd4ad-d20e-41c1-94a3-81e9491efee2
📒 Files selected for processing (1)
packages/extension/src/providers/ethereum/libs/transaction/decoder.ts
| isContractCreation, | ||
| dataHex: bufferToHex(dataDecoder.data), | ||
| toAddress: tx.to!, | ||
| toAddress: tx.to!.toLowerCase(), |
There was a problem hiding this comment.
🩺 Stability & Availability | 🔴 Critical | ⚡ Quick win
Crash on contract-creation transactions.
tx.to can be undefined/null (see Line 17: isContractCreation = tx.to ? false : true, and the optional toAddress?: string in DecodedTx). The ! non-null assertion is compile-time only and has no runtime effect, so calling .toLowerCase() unconditionally will throw a TypeError for every contract-creation transaction, where previously tx.to was simply passed through as-is without any method call.
🐛 Proposed fix
- toAddress: tx.to!.toLowerCase(),
+ toAddress: tx.to?.toLowerCase(),📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| toAddress: tx.to!.toLowerCase(), | |
| toAddress: tx.to?.toLowerCase(), |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/extension/src/providers/ethereum/libs/transaction/decoder.ts` at
line 89, The DecodedTx mapping in decoder.ts is still calling toLowerCase on
tx.to via a non-null assertion, which will crash for contract-creation
transactions where tx.to is absent. Update the decoding logic around the tx.to
assignment so it safely handles undefined/null values, preserving the existing
behavior for contract creation by leaving toAddress unset or passing through the
missing value without invoking string methods.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/extension-bridge/package.json`:
- Around line 52-53: Align the ESLint dependency with eslint-config-airbnb-base
in packages/extension-bridge/package.json (lines 52-53),
packages/hw-wallets/package.json (lines 28-29), packages/storage/package.json
(lines 33-34), packages/types/package.json (lines 31-32),
packages/utils/package.json (lines 36-37), and packages/swap/package.json (lines
47-48) by changing eslint from the 9.x range to a compatible ESLint 8.x range,
or consistently removing/migrating eslint-config-airbnb-base if ESLint 9 is
required; update the corresponding lockfile dependencies as needed.
In `@packages/keyring/package.json`:
- Around line 41-42: Align the ESLint and Airbnb configuration versions in
packages/keyring/package.json lines 41-42, packages/name-resolution/package.json
lines 28-29, packages/request/package.json lines 37-38,
packages/signers/bitcoin/package.json lines 38-39,
packages/signers/ethereum/package.json lines 38-39,
packages/signers/kadena/package.json lines 36-37,
packages/signers/massa/package.json lines 41-42, and
packages/signers/polkadot/package.json lines 37-38 by using an ESLint 8.x
version compatible with eslint-config-airbnb-base@15.0.0, or consistently
migrating/removing that Airbnb configuration in each affected manifest.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 00de45f2-ac56-40b0-9941-be478954ecf5
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (16)
package.jsonpackages/extension-bridge/package.jsonpackages/extension/package.jsonpackages/hw-wallets/package.jsonpackages/keyring/package.jsonpackages/name-resolution/package.jsonpackages/request/package.jsonpackages/signers/bitcoin/package.jsonpackages/signers/ethereum/package.jsonpackages/signers/kadena/package.jsonpackages/signers/massa/package.jsonpackages/signers/polkadot/package.jsonpackages/storage/package.jsonpackages/swap/package.jsonpackages/types/package.jsonpackages/utils/package.json
| "eslint": "^9.39.5", | ||
| "eslint-config-airbnb-base": "^15.0.0", |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
while IFS= read -r file; do
if jq -e '(.devDependencies.eslint // "") | startswith("^9")' "$file" >/dev/null &&
jq -e '(.devDependencies["eslint-config-airbnb-base"] // "") == "^15.0.0"' "$file" >/dev/null; then
printf 'incompatible pair: %s\n' "$file"
fi
done < <(fd --type f --glob 'package.json' .)
npm view eslint-config-airbnb-base@15.0.0 peerDependencies --jsonRepository: enkryptcom/enKrypt
Length of output: 208
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
printf 'Matching package.json files:\n'
while IFS= read -r file; do
printf '%s\n' "$file"
jq '{
file: .,
eslint: .devDependencies.eslint,
eslintConfigAirbBase: .devDependencies["eslint-config-airbnb-base"],
hasESLint9: ((.devDependencies.eslint // "") | startswith("^9")),
hasAirbnb15: ((.devDependencies["eslint-config-airbnb-base"] // "") == "^15.0.0")
}' "$file"
done < <(fd --type f --glob 'package.json' .)
printf '\nPeer dependencies for eslint-config-airbnb-base@15.0.0:\n'
npm view eslint-config-airbnb-base@15.0.0 peerDependencies --jsonRepository: enkryptcom/enKrypt
Length of output: 238
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
printf 'Found package.json files:\n'
fd --type f --glob 'package.json' . >/tmp/matching_package_jsons.txt
printf '\nDependencies in target package.json files:\n'
while IFS= read -r file; do
jq '{
file: .,
eslint: .devDependencies.eslint,
eslintConfigAirbnbBase: .devDependencies["eslint-config-airbnb-base"]
}' "$file" || true
done < /tmp/matching_package_jsons.txt
printf '\nDependency pairs:\n'
while IFS= read -r file; do
eslint="$(jq -r '.devDependencies.eslint // ""' "$file")"
airbnb="$(jq -r '.devDependencies["eslint-config-airbnb-base"] // ""' "$ file" 2>/dev/null || jq -r '.devDependencies["eslint-config-airbnb-base"] // ""' "$file")"
printf '%s eslint=%s airbnb=%s\n' "$file" "$eslint" "$airbnb"
done < /tmp/matching_package_jsons.txt
printf '\nPeer dependencies for eslint-config-airbnb-base@15.0.0:\n'
npm view eslint-config-airbnb-base@15.0.0 peerDependencies --json >/tmp/airbnb_peers.json
cat /tmp/airbnb_peers.jsonRepository: enkryptcom/enKrypt
Length of output: 35272
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
printf 'package.json files with both ESLint ^9 and eslint-config-airbnb-base ^15.0.0:\n'
while IFS= read -r file; do
eslint="$(jq -r '.devDependencies.eslint // ""' "$file" 2>/dev/null || true)"
airbnb="$(jq -r '.devDependencies["eslint-config-airbnb-base"] // ""' "$file" 2>/dev/null || true)"
if [ "${eslint#^9}" != "$eslint" ] && [ "$airbnb" = '^15.0.0' ]; then
printf '%s\n' "$file"
fi
done < <(fd --type f --glob 'package.json' .)
printf '\npackage.json files excluding these with ESLint ^9 and eslint-config-airbnb-base ^15.0.0:\n'
while IFS= read -r file; do
eslint="$(jq -r '.devDependencies.eslint // ""' "$file" 2>/dev/null || true)"
airbnb="$(jq -r '.devDependencies["eslint-config-airbnb-base"] // ""' "$file" 2>/dev/null || true)"
if [ "${eslint#^9}" != "$eslint" ] && [ "$airbnb" = '^15.0.0' ]; then
continue
fi
if [ "$eslint" = '^9.39.5' ] && [ -n "$airbnb" ]; then
printf 'skipped: %s\n' "$file"
elif [ "$eslint" = '^9.39.5' ]; then
printf 'no airbnb: %s\n' "$file"
else
printf 'other: %s eslint=%s airbnb=%s\n' "$file" "$eslint" "$airbnb"
fi
done < <(fd --type f --glob 'package.json' .)
printf '\nLockfile references to eslint-config-airbnb-base:\n'
if [ -f .yarnrc.yml ]; then
cat -n .yarnrc.yml | sed -n '1,220p'
fi
fd --type f 'yarn.lock|package-lock.json|pnpm-lock.yaml' . | while IFS= read -r lockfile; do
echo "--- $lockfile"
rg -n "eslint-config-airbnb-base@|eslint-config-airbnb-base:" "$lockfile" | head -20 || true
done
printf '\nNode semver check against ESLint 9.39.5:\n'
node - <<'JS'
const { satisfies } = require('semver');
const versions = ['9.39.5'];
const range = '^7.32.0 || ^8.2.0';
for (const v of versions) {
console.log(`${v} satisfies ${range}: ${satisfies(v, range)}`);
}
JSRepository: enkryptcom/enKrypt
Length of output: 287
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
echo 'package.json files with both ESLint ^9 and eslint-config-airbnb-base ^15.0.0:'
fd --type f --glob 'package.json' . > /tmp/package_jsons.txt
while IFS= read -r file; do
eslint="$(jq -r '.devDependencies.eslint // ""' "$file")"
airbnb="$(jq -r '.devDependencies["eslint-config-airbnb-base"] // ""' "$file")"
if [ "$eslint" = '^9' ] || echo "$eslint" | grep -q '^9\.' || echo "$eslint" | grep -q '^9\^' || [ "$eslint" = '^9.39.5' ]; then
if [ "$airbnb" = '^15.0.0' ]; then
echo "$file"
fi
fi
done < /tmp/package_jsons.txt
echo
echo 'Relevant workspace files only:'
for f in packages/extension-bridge/package.json packages/hw-wallets/package.json packages/storage/package.json packages/types/package.json packages/utils/package.json packages/swap/package.json; do
if [ -f "$f" ]; then
printf '%s: eslint=%s airbnb=%s\n' "$f" "$(jq -r '.devDependencies.eslint // ""' "$f")" "$(jq -r '.devDependencies["eslint-config-airbnb-base"] // ""' "$f")"
else
printf '%s missing\n' "$f"
fi
done
echo
echo 'Lockfile references:'
fd --type f 'yarn.lock$|package-lock.json$|pnpm-lock.yaml$' . > /tmp/lockfiles.txt
if [ -s /tmp/lockfiles.txt ]; then
while IFS= read -r lockfile; do
echo "--- $lockfile"
rg -n "eslint-config-airbnb-base" "$lockfile" | head -20 || true
done < /tmp/lockfiles.txt
else
echo 'no lockfile found'
fi
echo
echo 'Semver capability check (if semver is available):'
node > /tmp/semver.js <<'JS'
import { satisfies } from 'semver';
const versions = ['9.39.5', '8.8.0', '9.0.0'];
const range = '^7.32.0 || ^8.2.0';
for (const v of versions) {
console.log(`${v} satisfies ${range}: ${satisfies(v, range)}`);
}
JS
node /tmp/semver.js || true
echo
echo 'Node semver check (if semver is available):'
node <<'JS'
const { satisfies } = require('semver');
const versions = ['9.39.5', '8.8.0', '9.0.0'];
const range = '^7.32.0 || ^8.2.0';
for (const v of versions) {
console.log(`${v} satisfies ${range}: ${satisfies(v, range)}`);
}
JSRepository: enkryptcom/enKrypt
Length of output: 3035
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
echo 'eslint-config-airbnb-base@15.0.0 package metadata:'
npm view eslint-config-airbnb-base@15.0.0 name version peerDependencies --json
echo
echo 'All packages listing both eslint eslint-config-airbnb-base, sorted:'
jq -r '{path:., package: .name, eslint: .devDependencies.eslint, airbnb: .devDependencies["eslint-config-airbnb-base"]}' "$(jq -r '.package' /tmp/package_jsons.txt)" | jq -rs 'sort_by(.package)'Repository: enkryptcom/enKrypt
Length of output: 878
Align ESLint with eslint-config-airbnb-base in every workspace using this pair.
Every package.json that uses eslint-config-airbnb-base@^15.0.0 also pins eslint@^9.39.5, but eslint-config-airbnb-base@15.0.0 only peers with eslint ^7.32.0 || ^8.2.0. Use an ESLint 8.x range, or remove/migrate this config if ESLint 9 is required.
📍 Affects 6 files
packages/extension-bridge/package.json#L52-L53(this comment)packages/hw-wallets/package.json#L28-L29packages/storage/package.json#L33-L34packages/types/package.json#L31-L32packages/utils/package.json#L36-L37packages/swap/package.json#L47-L48
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/extension-bridge/package.json` around lines 52 - 53, Align the
ESLint dependency with eslint-config-airbnb-base in
packages/extension-bridge/package.json (lines 52-53),
packages/hw-wallets/package.json (lines 28-29), packages/storage/package.json
(lines 33-34), packages/types/package.json (lines 31-32),
packages/utils/package.json (lines 36-37), and packages/swap/package.json (lines
47-48) by changing eslint from the 9.x range to a compatible ESLint 8.x range,
or consistently removing/migrating eslint-config-airbnb-base if ESLint 9 is
required; update the corresponding lockfile dependencies as needed.
Source: MCP tools
| "eslint": "^9.39.5", | ||
| "eslint-config-airbnb-base": "^15.0.0", |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
fd -t f '^package\.json$' packages -x jq -r '
select(
.devDependencies.eslint == "^9.39.5" and
.devDependencies["eslint-config-airbnb-base"] == "^15.0.0"
) | input_filename
'
npm view eslint-config-airbnb-base@15.0.0 peerDependencies --json
npm install --dry-run --ignore-scripts --strict-peer-deps --package-lock=falseRepository: enkryptcom/enKrypt
Length of output: 1535
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
printf 'Root package manager/workspaces config:\n'
if [ -f package.json ]; then jq '{packageManager, workspaces, dependencies, devDependencies, npmConfig}' package.json; fi
printf '\nManifest entries for affected ESLint/Airbnb pairs:\n'
fd -t f '^package\.json$' packages -x sh -c '
j="$1"
name=$(jq -r ".name // empty" "$j")
if jq -e ".devDependencies.eslint == \"^9.39.5\" and .devDependencies[\"eslint-config-airbnb-base\"] == \"^15.0.0\"" "$j" >/dev/null; then
jq -r ".name as \$n | \"\($n)\$j\"\ndevDependencies.eslint=\(.devDependencies.eslint), devDependencies[\`eslint-config-airbnb-base\`]=\(.devDependencies[\"eslint-config-airbnb-base\"])" "$j"
fi
' sh {}
printf '\nAll eslint-config-airbnb-base versions in packages manifests:\n'
fd -t f '^package\.json$' packages -x jq -r '
select(.devDependencies["eslint-config-airbnb-base"]? and .devDependencies.eslint? and (
.devDependencies.eslint == "^9.39.5" or .devDependencies["eslint-config-airbnb-base"] == "^15.0.0"
)) |
"name=\(.name) eslint=\(.devDependencies.eslint) airbnb-base=\(.devDependencies[\"eslint-config-airbnb-base\"]) scripts=\(.scripts // {} | tostring | gsub("\n"; " "))"
'
printf '\nWorkspace/lint scripts mentioning eslint:\n'
fd -t f '^package\.json$' . -x sh -c '
j="$1"
if jq -e ".scripts | .[keys[] | select(test(\"eslint\"))] != null" "$j" >/dev/null; then
echo "--- $j"
jq -r ".scripts | .[keys[] | select(test(\"eslint\"))]" "$j"
fi
' sh {}Repository: enkryptcom/enKrypt
Length of output: 5289
🌐 Web query:
eslint-config-airbnb-base npm package.json peerDependencies eslint-plugin-import
💡 Result:
The eslint-config-airbnb-base npm package lists eslint and eslint-plugin-import as peer dependencies in its package.json file [1]. Because peer dependencies are not automatically installed by npm, you must install the correct versions of these packages alongside eslint-config-airbnb-base [2][3]. To install the required peer dependencies, the official Airbnb JavaScript style guide documentation recommends the following methods: 1. Using npx (simplest method): Run the following command to automatically detect and install the correct versions: npx install-peerdeps --dev eslint-config-airbnb-base [2][3] 2. Using npm/yarn manually: If you prefer manual installation, you can list the required versions by running: npm info "eslint-config-airbnb-base@latest" peerDependencies [2][3] Then, install those specific versions as development dependencies using your preferred package manager (e.g., npm install --save-dev @ or yarn add --dev @) [2][3]. For older versions of npm (< 5), the documentation provides shell command variations to pipe the peer dependency information directly into an install command [2][3]. Always verify the current requirements via npm info as versions are updated periodically [2][1].
Citations:
- 1: https://www.jsdocs.io/package/eslint-config-airbnb-base
- 2: https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/README.md
- 3: https://www.npmjs.com/package/eslint-config-airbnb-base
🌐 Web query:
npm install --workspace strict-peer-deps peerDependencies version range
💡 Result:
The command npm install --strict-peer-deps relates to how npm handles conflicting peer dependencies, while the --workspace (or -w) flag allows you to operate within the context of specific packages in a workspace-based project [1][2]. These are separate configuration options that can be used together, but they serve different purposes [1]. Strict Peer Dependencies (--strict-peer-deps) When set to true, the --strict-peer-deps flag forces npm to treat any conflicting peerDependencies as an installation failure, halting the process with an ERESOLVE error [1][3]. By default (when this flag is false), npm attempts to resolve peer dependency conflicts automatically using heuristics, such as using the nearest non-peer dependency specification, even if that results in a version outside the range defined in a package's peerDependencies object [1][3]. This flag is useful for CI/CD pipelines or strict development environments where you want to ensure the dependency tree strictly adheres to all specified peer dependency ranges [3]. Workspaces (--workspace) The --workspace (or -w) flag restricts the npm command to run only within the context of a specified workspace package [1][2]. When running npm install --workspace , npm will install dependencies for that specific workspace, while still respecting the overall dependency graph of your workspace project [1][4]. You can combine these options (e.g., npm install --workspace=my-app --strict-peer-deps) to enforce strict peer dependency checking specifically when installing dependencies for that workspace [1]. If you are experiencing issues where peer dependencies do not seem to respect version ranges within workspaces, ensure that your workspace definitions are correctly nested within the root project's structure, as npm expects workspaces to be part of the defined root configuration [5]. If a conflict arises that you cannot resolve, npm provides --legacy-peer-deps as an alternative to ignore peer dependency requirements entirely, though this is generally discouraged for long-term project stability [1][3].
Citations:
- 1: https://docs.npmjs.com/cli/v11/commands/npm-install/
- 2: https://docs.npmjs.com/cli/v7/using-npm/config/
- 3: https://github.com/npm/rfcs/blob/main/implemented/0031-handling-peer-conflicts.md
- 4: https://github.com/npm/rfcs/blob/main/implemented/0026-workspaces.md
- 5: [BUG] not installing peer dependencies for workspaces if they are not nested inside the root package npm/cli#2650
🌐 Web query:
npm install --lockfile-version 1 strict-peer-deps yarn 4 workspaces
💡 Result:
The command you provided combines several npm configuration flags and concepts, but it is important to understand how they interact, especially when used in the context of a Yarn 4 workspace project. Command Analysis: npm install --lockfile-version 1 --strict-peer-deps 1. --lockfile-version 1: This flag instructs npm to generate a package-lock.json file compatible with npm versions 5 and 6 [1][2]. While supported, this is generally not recommended for modern projects as it lacks the detailed metadata used by newer npm versions to ensure faster, more deterministic installs [1]. Note that npm v7 and above default to newer versions (v2 or v3) and will auto-convert v1 files [1][2]. 2. --strict-peer-deps: This flag forces npm to halt the installation process if it encounters any conflicting peer dependencies [3][4][5]. By default, npm v7+ attempts to resolve peer dependency conflicts automatically using heuristics; enabling this flag disables that behavior, treating any warning as an install failure [4][6]. Using npm with Yarn 4 Workspaces: You should exercise caution when using npm to install dependencies in a project managed by Yarn workspaces. - Package Manager Incompatibility: Yarn and npm are not interchangeable [7]. They manage lockfiles (yarn.lock vs. package-lock.json), dependency resolution strategies, and workspace implementation details differently [8][7]. - Workspace Conflicts: While npm v7+ supports its own workspace implementation [9][10], it may not correctly interpret the specific workspace configuration or protocols (such as the workspace: protocol) used by Yarn [11]. Running npm install in a Yarn-managed monorepo can lead to inconsistent node_modules structures, corrupted lockfiles, and errors during build or runtime [7]. Recommendation: If your project is configured as a Yarn 4 workspace, it is highly recommended to use the yarn command (e.g., yarn install) exclusively [7]. Mixing package managers often leads to unpredictable behavior and is strongly discouraged by the maintainers of both tools [7].
Citations:
- 1: https://docs.npmjs.com/cli/v11/using-npm/config/?v=true
- 2: https://docs.npmjs.com/cli/v11/configuring-npm/package-lock-json/
- 3: https://github.com/npm/rfcs/blob/main/implemented/0031-handling-peer-conflicts.md
- 4: https://docs.npmjs.com/cli/v11/commands/npm-install-test/
- 5: https://docs.npmjs.com/cli/v11/commands/npm-dedupe/
- 6: https://stackoverflow.com/questions/66020820/npm-when-to-use-force-and-legacy-peer-deps
- 7: https://yarnpkg.com/advanced/rulebook
- 8: https://yarnpkg.com/advanced/changelog
- 9: https://stackoverflow.com/questions/46947557/do-yarn-workspaces-work-with-npm-too
- 10: https://docs.npmjs.com/cli/v8/using-npm/workspaces
- 11: `npm` protocol switch to `workspace` resolution yarnpkg/berry#4015
🌐 Web query:
npm 9.39.5 eslint 9 package.json
💡 Result:
ESLint version 9.39.5 is a valid, released version of the ESLint library, published on July 10, 2026 [1][2][3]. Regarding the use of ESLint 9 in your package.json, there are several key points to consider based on the current standards for ESLint v9.x: 1. Installation: You can install this specific version as a development dependency using npm: npm install --save-dev eslint@9.39.5 @eslint/js@9.39.5 [4] 2. Configuration File Change: In ESLint v9, the use of the eslintConfig key within package.json is no longer supported [5]. You must now use a standalone configuration file, typically named eslint.config.js [5][6]. 3. Flat Config System: ESLint v9 introduced the "flat config" system [7][8]. Your eslint.config.js file must use this format, which replaces the older eslintrc-style configuration [9][5]. 4. Maintenance Status: As of August 5, 2026, ESLint v9 is in its final stages of maintenance, with support officially ending on August 6, 2026 [7][10]. Users are encouraged to consider migrating to ESLint v10 or newer versions [10]. For further setup, the official recommendation is to use the initialization command, which will help set up the necessary files for your specific project environment: npm init @eslint/config@latest [4][11]
Citations:
- 1: https://github.com/eslint/eslint/releases/tag/v9.39.5
- 2: eslint/eslint@v9.39.4...v9.39.5
- 3: https://newreleases.io/project/npm/eslint/release/9.39.5
- 4: https://eslint.org/docs/latest/use/getting-started
- 5: https://eslint.org/docs/latest/use/configure/migration-guide
- 6: https://eslint.org/docs/latest/use/configure/configuration-files
- 7: https://eslint.org/blog/2024/04/eslint-v9.0.0-released/
- 8: https://eslint.org/blog/2024/05/eslint-compatibility-utilities/
- 9: https://eslint.org/docs/latest/use/migrate-to-9.0.0
- 10: https://endoflife.date/eslint
- 11: https://www.npmjs.com/package/eslint
🌐 Web query:
Airbnb JavaScript style guide ESLint config airbnb-base ESLint 9 compatibility
💡 Result:
As of August 5, 2026, the official eslint-config-airbnb-base package has not been updated to formally support ESLint 9 [1][2]. The package continues to list ESLint 7 and 8 as peer dependencies [3], and it does not natively support the ESLint flat configuration system [2][4]. While there are open pull requests to add flat config support [2], they have not been merged [2]. Consequently, users attempting to use the official Airbnb configuration with ESLint 9 face compatibility challenges, including peer dependency conflicts [5]. Community workarounds and alternative approaches include: 1. Compatibility Layers: Developers often use the @eslint/eslintrc package's FlatCompat utility to bridge the gap between legacy configuration and ESLint 9's flat config system [6]. This allows the use of existing Airbnb configs within an eslint.config.js file, though it may require additional steps to address deprecated rule sets [6]. 2. Community Packages: Third-party wrappers, such as airbnb-eslint9, have been created to provide the Airbnb ruleset in a flat configuration format compatible with ESLint 9 [5]. These solutions often involve manually handling peer dependencies (e.g., using --legacy-peer-deps) [5] and sometimes include migrating deprecated formatting rules to @stylistic/eslint-plugin [5][6]. For production environments, it is recommended to monitor the official airbnb/javascript repository [1] for updates or consider migrating to modern, natively supported configuration alternatives if project constraints allow.
Citations:
- 1: eslint v9 support airbnb/javascript#2961
- 2: Support flat config for
eslint-config-airbnb-baseairbnb/javascript#3061 - 3: https://www.npmjs.com/package/eslint-config-airbnb-base
- 4: Compatibility with new eslint config spec airbnb/javascript#2642
- 5: https://npmx.dev/package/airbnb-eslint9
- 6: https://gist.github.com/xfournet/ed9f2f02e411b86188bad4aeb9b1bddb
Align eslint-config-airbnb-base and ESLint in affected manifests.
eslint-config-airbnb-base@15.0.0 declares eslint peer dependencies ^7.32.0 || ^8.2.0, while the listed packages request ESLint ^9.39.5. Use ESLint 8.x with this Airbnb package, or migrate/remove the Airbnb config in these manifests.
packages/keyring/package.jsonpackages/name-resolution/package.jsonpackages/request/package.jsonpackages/signers/bitcoin/package.jsonpackages/signers/ethereum/package.jsonpackages/signers/kadena/package.jsonpackages/signers/massa/package.jsonpackages/signers/polkadot/package.json
📍 Affects 8 files
packages/keyring/package.json#L41-L42(this comment)packages/name-resolution/package.json#L28-L29packages/request/package.json#L37-L38packages/signers/bitcoin/package.json#L38-L39packages/signers/ethereum/package.json#L38-L39packages/signers/kadena/package.json#L36-L37packages/signers/massa/package.json#L41-L42packages/signers/polkadot/package.json#L37-L38
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/keyring/package.json` around lines 41 - 42, Align the ESLint and
Airbnb configuration versions in packages/keyring/package.json lines 41-42,
packages/name-resolution/package.json lines 28-29, packages/request/package.json
lines 37-38, packages/signers/bitcoin/package.json lines 38-39,
packages/signers/ethereum/package.json lines 38-39,
packages/signers/kadena/package.json lines 36-37,
packages/signers/massa/package.json lines 41-42, and
packages/signers/polkadot/package.json lines 37-38 by using an ESLint 8.x
version compatible with eslint-config-airbnb-base@15.0.0, or consistently
migrating/removing that Airbnb configuration in each affected manifest.
Source: MCP tools
Summary by CodeRabbit
Bug Fixes
Chores