fix(lint): repair the three remaining parse errors on master - #1119
Open
Sensei-Victor wants to merge 1 commit into
Open
Sensei-Victor wants to merge 1 commit into
Sensei-Victor wants to merge 1 commit into
Conversation
|
Someone is attempting to deploy a commit to the nanle-code's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Hey @Sensei-Victor! 👋 It looks like this PR isn't linked to any issue. If this PR is for one of the issues assigned to you as part of a Wave, please link it to ensure your contribution is tracked properly. You can do this by adding a keyword to the PR description (e.g.,
|
tests/csp.test.js imports `{ describe, it, expect }` from 'vitest'
twice - on line 1 and again on line 5. ESLint rejects the file outright:
5:10 error Parsing error: Identifier 'describe' has already been declared
Because the file does not parse, ESLint could not check it and Vitest
could not transform it, so the whole file was silently excluded from both
the lint result and the test run. Removing the duplicate import is the
entire fix.
This is the last of master's parse errors that is not also a build blocker.
The other three have been fixed on master or in Nanle-code#1108.
Effect: the file contributes 8 passing tests that previously did not
exist in the run at all.
Sensei-Victor
force-pushed
the
fix/remaining-parse-errors
branch
from
September 29, 2026 11:26
6886778 to
a9aed36
Compare
Sensei-Victor
pushed a commit
to Sensei-Victor/stellar-dev-dashboard
that referenced
this pull request
Sep 29, 2026
…ortfolioRebalancer The `local/no-direct-submit` rule (Nanle-code#983) landed in 7d6ea30 three days ago and has been failing `pnpm run lint` ever since: 8 errors, none of them triaged. This PR resolves all 8 and leaves Lint & Format Check green. The rule's own docstring says it "forbids calling server.submitTransaction() or sendTransaction() directly from component code", but the implementation flagged every file in the repo. That is not workable, because the remedy the rule prescribes - useWriteGuard().guard() - is a React hook, so non-component code cannot satisfy it at all. Three of the four remaining production violations are in src/lib/*.ts transport helpers. Two changes: 1. eslint-rules/no-direct-submit.mjs now returns early for anything outside src/components/. The transport layers stay on the explicit ALLOWLIST as before; scripts/ and docs/ are no longer in scope, since they have no user to confirm with. The guard is unchanged for component code, which is where the mainnet risk actually lives. 2. src/components/dashboard/PortfolioRebalancer.tsx was the one genuine component violation: "Execute Live Rebalance" called signAndSubmitTransaction() straight from the click handler, with no confirmation gate, so a real write could reach the network with a single click. It now goes through useWriteGuard(), matching how TransactionSigner already does it, and renders <MainnetConfirmDialog {...dialogProps} />. The handler is split into handleLiveExecute (the guarded entry point) and runLiveExecute (the work), so the submit is only reachable from the guard's onConfirm. The import is aliased to submitSignedTransaction. The rule matches on the callee's identifier, and the symbol comes from the already allowlisted src/lib/transactionBuilder, so the rule flags the call site in the component regardless of where the function was defined. The alias makes the guarded path explicit at the call site. On mainnet, clicking "Execute Live Rebalance" now requires typing "mainnet" to confirm, and is blocked entirely when the per-session mainnet read-only lock is active. Non-mainnet networks proceed immediately, as guard() is designed to. Lint: 14 errors on master -> 5 with this PR (the remaining 5 are the parse errors fixed in Nanle-code#1108 and Nanle-code#1119). All 8 no-direct-submit errors are resolved. Warnings unchanged at 2258. Verified: `pnpm exec tsc --noEmit` reports no errors in PortfolioRebalancer.tsx.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix(lint): remove duplicate vitest import in tests/csp.test.js
tests/csp.test.jsimports{ describe, it, expect }from'vitest'twice — on line 1 and again on line 5:ESLint rejects the file outright:
Because the file does not parse, ESLint cannot check it and Vitest cannot transform it, so the whole file was silently excluded from both the lint result and the test run. Removing the duplicate import is the entire fix — no behaviour change.
Effect
Context
This is the last of
master's parse errors that is not also a build blocker.pnpm run lintonmaster(a0c6c845) reports 10 errors:local/no-direct-submit… plus 5 more of the sameAuditLog.tsxunterminated JSXtests/csp.test.jsduplicatedescribelocal/no-direct-submitWith all three PRs applied,
pnpm run lintreports 0 errors and exits 0 — verified on a clean cherry-pick of all three ontomaster:Independence
One file, one deleted line. No overlap with #1108 or #1121; all three cherry-pick onto
mastercleanly together and merge in any order.