fix: add eslint-disable for unsafe member access and fix webpack header

This commit is contained in:
2026-01-08 11:31:54 +03:00
parent ade75e7078
commit e64f846b0d
3 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2026 @polkadot/apps authors & contributors
// Copyright 2017-2026 @pezkuwi/apps-electron authors & contributors
// SPDX-License-Identifier: Apache-2.0
/* eslint-disable camelcase */
+2
View File
@@ -19,11 +19,13 @@ function needsApiCheck (api: ApiPromise): boolean {
}
// we need a known Exposure type
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const { nominatorCount, own, pageCount, total } = api.registry.createType<SpStakingPagedExposureMetadata>(
unwrapStorageType(api.registry, api.query.staking.erasStakersOverview.creator.meta.type),
{ nominatorCount: BN_ONE, own: BN_ONE, pageCount: BN_ONE, total: BN_ONE }
);
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
assert(total && own && nominatorCount && pageCount && total.eq(BN_ONE) && own.eq(BN_ONE), 'Needs a known Exposure type');
} catch {
console.warn('Unable to create known-shape Exposure type, disabling staking route');
+2
View File
@@ -13,11 +13,13 @@ import { assert, BN_ONE } from '@pezkuwi/util';
function needsApiCheck (api: ApiPromise): boolean {
try {
// we need a known Exposure type
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const { others: [{ value, who }], own, total } = api.registry.createType<SpStakingExposure>(
unwrapStorageType(api.registry, api.query.staking.erasStakers.creator.meta.type),
{ others: [{ value: BN_ONE, who: ZERO_ACCOUNT }], own: BN_ONE, total: BN_ONE }
);
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
assert(total && own && value && who && total.eq(BN_ONE) && own.eq(BN_ONE) && value.eq(BN_ONE), 'Needs a known Exposure type');
} catch {
console.warn('Unable to create known-shape Exposure type, disabling staking route');