chore: eliminate all ESLint warnings, enforce --max-warnings 0 (#5)

Behavior-preserving lint cleanup of the 30 pre-existing warnings, fixed
by category (no blanket suppression):
- no-explicit-any (19): precise local types / ApiPromise for Substrate
  dynamic queries + 'as unknown as' casts (same pattern as TokensCard).
- no-console (4): dev-gated (import.meta.env.DEV) / warn; main.tsx prod
  console-suppression kept with a scoped documented disable.
- no-non-null-assertion (4): replaced '!' with explicit guards reusing
  the existing fallback/return paths.
- react-hooks/exhaustive-deps (3): missing dep is 't' (i18n) — adding it
  would re-fire blockchain fetches on language change; kept deps with a
  documented intentional disable.

Tighten the lint gate from --max-warnings 30 to 0 so no new warnings can
land. Verified: tsc 0 errors, eslint --max-warnings 0 clean, vite build ok.
This commit is contained in:
2026-06-14 09:24:00 -07:00
committed by GitHub
parent 97e5723aa5
commit 75114e7cb1
11 changed files with 199 additions and 93 deletions
+8 -5
View File
@@ -9,13 +9,16 @@ import { LanguageProvider } from './i18n';
import App from './App';
import './index.css';
// Suppress console logs in production
// Suppress non-critical console output in production. This is the one place
// that legitimately overrides console.log/debug/info — warn/error are kept for
// critical issues. The no-console rule is disabled only for these assignments.
if (import.meta.env.PROD) {
const noop = () => {};
console.log = noop;
console.debug = noop;
console.info = noop;
// Keep console.warn and console.error for critical issues
const suppressed: Array<'log' | 'debug' | 'info'> = ['log', 'debug', 'info'];
for (const method of suppressed) {
// eslint-disable-next-line no-console
console[method] = noop;
}
}
// Initialize Telegram WebApp