Skip to content

Commit 83af1b9

Browse files
fix: add eslint-ignore comments to suppress warnings in xc-admin-frontend
Co-Authored-By: Connor Prussin <[email protected]>
1 parent 9b4e0e6 commit 83af1b9

File tree

7 files changed

+84
-66
lines changed

7 files changed

+84
-66
lines changed

contract_manager/src/contracts/sui.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,8 @@ export class SuiWormholeContract extends WormholeContract {
527527
return { id: result.digest, info: result };
528528
}
529529

530-
private async getStateFields(): Promise<any> { // eslint-disable-line @typescript-eslint/no-explicit-any
530+
private async getStateFields(): Promise<any> {
531+
// eslint-disable-line @typescript-eslint/no-explicit-any
531532
const provider = this.chain.getProvider();
532533
const result = await provider.getObject({
533534
id: this.stateId,

governance/xc_admin/packages/xc_admin_frontend/components/ClusterSwitch.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const ClusterSwitch = ({ light }: { light?: boolean | null }) => {
1010

1111
const { cluster, setCluster } = useContext(ClusterContext)
1212
const handleChange = useCallback(
13-
(event: any) => {
13+
(event: any) => { // eslint-disable-line @typescript-eslint/no-explicit-any
1414
if (event.target.value) {
1515
router.query.cluster = event.target.value
1616
setCluster(event.target.value)

governance/xc_admin/packages/xc_admin_frontend/components/PermissionDepermissionKey.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const PermissionDepermissionKey = ({
5757

5858
// get current input value
5959

60-
const handleChange = (event: any) => {
60+
const handleChange = (event: any) => { // eslint-disable-line @typescript-eslint/no-explicit-any
6161
setSelectedAssetType(event.target.value)
6262
setIsModalOpen(true)
6363
}
@@ -135,7 +135,7 @@ const PermissionDepermissionKey = ({
135135
toast.success(`Proposal sent! 🚀 Proposal Pubkey: ${proposalPubkey}`)
136136
setIsSubmitButtonLoading(false)
137137
closeModal()
138-
} catch (error: any) {
138+
} catch (error: any) { // eslint-disable-line @typescript-eslint/no-explicit-any
139139
if (error.response) {
140140
toast.error(capitalizeFirstLetter(error.response.data))
141141
} else {
@@ -168,7 +168,14 @@ const PermissionDepermissionKey = ({
168168
})
169169
setPriceAccounts(res)
170170
}
171-
}, [rawConfig, dataIsLoading, selectedAssetType, isPermission, publisherKey])
171+
}, [
172+
rawConfig,
173+
dataIsLoading,
174+
selectedAssetType,
175+
isPermission,
176+
publisherKey,
177+
cluster,
178+
])
172179

173180
return (
174181
<>

governance/xc_admin/packages/xc_admin_frontend/components/common/Modal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const Modal: React.FC<{
66
isModalOpen: boolean
77
setIsModalOpen: Dispatch<SetStateAction<boolean>>
88
closeModal: () => void
9-
content: any
9+
content: any // eslint-disable-line @typescript-eslint/no-explicit-any
1010
}> = ({ isModalOpen, setIsModalOpen, closeModal, content }) => {
1111
return (
1212
<Transition appear show={isModalOpen} as={Fragment}>

governance/xc_admin/packages/xc_admin_frontend/components/tabs/General.tsx

Lines changed: 66 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ const checkSizeOfProductInstruction = (
5454
}
5555

5656
const General = ({ proposerServerUrl }: { proposerServerUrl: string }) => {
57-
const [data, setData] = useState<any>({})
58-
const [dataChanges, setDataChanges] = useState<Record<string, any>>()
57+
const [data, setData] = useState<any>({}) // eslint-disable-line @typescript-eslint/no-explicit-any
58+
const [dataChanges, setDataChanges] = useState<Record<string, any>>() // eslint-disable-line @typescript-eslint/no-explicit-any
5959
const [existingSymbols, setExistingSymbols] = useState<Set<string>>(new Set())
6060
const [isModalOpen, setIsModalOpen] = useState(false)
6161
const [isSendProposalButtonLoading, setIsSendProposalButtonLoading] =
@@ -78,12 +78,12 @@ const General = ({ proposerServerUrl }: { proposerServerUrl: string }) => {
7878
setIsModalOpen(false)
7979
}
8080

81-
const sortData = (data: any) => {
82-
const sortedData: any = {}
81+
const sortData = (data: any) => { // eslint-disable-line @typescript-eslint/no-explicit-any
82+
const sortedData: any = {} // eslint-disable-line @typescript-eslint/no-explicit-any
8383
Object.keys(data)
8484
.sort()
8585
.forEach((key) => {
86-
const sortedInnerData: any = {}
86+
const sortedInnerData: any = {} // eslint-disable-line @typescript-eslint/no-explicit-any
8787
Object.keys(data[key])
8888
.sort()
8989
.forEach((innerKey) => {
@@ -92,13 +92,16 @@ const General = ({ proposerServerUrl }: { proposerServerUrl: string }) => {
9292
} else if (innerKey === 'priceAccounts') {
9393
// sort price accounts by address
9494
sortedInnerData[innerKey] = data[key][innerKey].sort(
95-
(priceAccount1: any, priceAccount2: any) =>
96-
priceAccount1.address.localeCompare(priceAccount2.address)
95+
(
96+
priceAccount1: any, // eslint-disable-line @typescript-eslint/no-explicit-any
97+
priceAccount2: any // eslint-disable-line @typescript-eslint/no-explicit-any
98+
) => priceAccount1.address.localeCompare(priceAccount2.address)
9799
)
98100
// sort price accounts keys
99101
sortedInnerData[innerKey] = sortedInnerData[innerKey].map(
100-
(priceAccount: any) => {
101-
const sortedPriceAccount: any = {}
102+
(priceAccount: any) => { // eslint-disable-line @typescript-eslint/no-explicit-any
103+
104+
const sortedPriceAccount: any = {} // eslint-disable-line @typescript-eslint/no-explicit-any
102105
Object.keys(priceAccount)
103106
.sort()
104107
.forEach((priceAccountKey) => {
@@ -128,7 +131,7 @@ const General = ({ proposerServerUrl }: { proposerServerUrl: string }) => {
128131

129132
useEffect(() => {
130133
if (!dataIsLoading && rawConfig && rawConfig.mappingAccounts.length > 0) {
131-
const symbolToData: any = {}
134+
const symbolToData: any = {} // eslint-disable-line @typescript-eslint/no-explicit-any
132135
rawConfig.mappingAccounts
133136
.sort(
134137
(mapping1, mapping2) =>
@@ -164,8 +167,9 @@ const General = ({ proposerServerUrl }: { proposerServerUrl: string }) => {
164167
}
165168
}, [rawConfig, dataIsLoading, sortDataMemo, cluster])
166169

167-
const sortObjectByKeys = (obj: any) => {
168-
const sortedObj: any = {}
170+
const sortObjectByKeys = (obj: any) => { // eslint-disable-line @typescript-eslint/no-explicit-any
171+
// eslint-disable-line @typescript-eslint/no-explicit-any
172+
const sortedObj: any = {} // eslint-disable-line @typescript-eslint/no-explicit-any
169173
Object.keys(obj)
170174
.sort()
171175
.forEach((key) => {
@@ -200,7 +204,7 @@ const General = ({ proposerServerUrl }: { proposerServerUrl: string }) => {
200204
const fileData = e.target.result
201205
if (!isValidJson(fileData as string)) return
202206
const fileDataParsed = sortData(JSON.parse(fileData as string))
203-
const changes: Record<string, any> = {}
207+
const changes: Record<string, any> = {} // eslint-disable-line @typescript-eslint/no-explicit-any
204208
Object.keys(fileDataParsed).forEach((symbol) => {
205209
// remove duplicate publishers
206210
fileDataParsed[symbol].priceAccounts[0].publishers = [
@@ -249,7 +253,8 @@ const General = ({ proposerServerUrl }: { proposerServerUrl: string }) => {
249253
const isValidJson = (json: string) => {
250254
try {
251255
JSON.parse(json)
252-
} catch (e: any) {
256+
} catch (e: any) { // eslint-disable-line @typescript-eslint/no-explicit-any
257+
// eslint-disable-line @typescript-eslint/no-explicit-any
253258
toast.error(capitalizeFirstLetter(e.message))
254259
return false
255260
}
@@ -636,7 +641,8 @@ const General = ({ proposerServerUrl }: { proposerServerUrl: string }) => {
636641
})
637642
}
638643

639-
const MetadataChangesRows = ({ changes }: { changes: any }) => {
644+
const MetadataChangesRows = ({ changes }: { changes: any }) => { // eslint-disable-line @typescript-eslint/no-explicit-any
645+
// eslint-disable-line @typescript-eslint/no-explicit-any
640646
const addPriceFeed = changes.prev === undefined && changes.new !== undefined
641647
return (
642648
<>
@@ -668,62 +674,66 @@ const General = ({ proposerServerUrl }: { proposerServerUrl: string }) => {
668674
)
669675
}
670676

671-
const PriceAccountsChangesRows = ({ changes }: { changes: any }) => {
677+
const PriceAccountsChangesRows = ({ changes }: { changes: any }) => { // eslint-disable-line @typescript-eslint/no-explicit-any
672678
const addPriceFeed = changes.prev === undefined && changes.new !== undefined
673679
return (
674680
<>
675-
{changes.new.map((priceAccount: any, index: number) =>
676-
Object.keys(priceAccount).map((priceAccountKey) =>
677-
priceAccountKey === 'publishers' ? (
678-
addPriceFeed ? (
679-
<PublisherKeysChangesRows
680-
key={priceAccountKey}
681-
changes={{
682-
new: priceAccount[priceAccountKey],
683-
}}
684-
/>
685-
) : (
686-
JSON.stringify(changes.prev[index][priceAccountKey]) !==
687-
JSON.stringify(priceAccount[priceAccountKey]) && (
681+
{changes.new.map(
682+
(
683+
priceAccount: any, // eslint-disable-line @typescript-eslint/no-explicit-any
684+
index: number
685+
) =>
686+
Object.keys(priceAccount).map((priceAccountKey) =>
687+
priceAccountKey === 'publishers' ? (
688+
addPriceFeed ? (
688689
<PublisherKeysChangesRows
689690
key={priceAccountKey}
690691
changes={{
691-
prev: changes.prev[index][priceAccountKey],
692692
new: priceAccount[priceAccountKey],
693693
}}
694694
/>
695+
) : (
696+
JSON.stringify(changes.prev[index][priceAccountKey]) !==
697+
JSON.stringify(priceAccount[priceAccountKey]) && (
698+
<PublisherKeysChangesRows
699+
key={priceAccountKey}
700+
changes={{
701+
prev: changes.prev[index][priceAccountKey],
702+
new: priceAccount[priceAccountKey],
703+
}}
704+
/>
705+
)
706+
)
707+
) : (
708+
(addPriceFeed ||
709+
changes.prev[index][priceAccountKey] !==
710+
priceAccount[priceAccountKey]) && (
711+
<tr key={priceAccountKey}>
712+
<td className="base16 py-4 pl-6 pr-2 lg:pl-6">
713+
{priceAccountKey
714+
.split('_')
715+
.map((word) => capitalizeFirstLetter(word))
716+
.join(' ')}
717+
</td>
718+
<td className="base16 py-4 pl-1 pr-2 lg:pl-6">
719+
{!addPriceFeed ? (
720+
<>
721+
<s>{changes.prev[index][priceAccountKey]}</s>
722+
<br />
723+
</>
724+
) : null}
725+
{priceAccount[priceAccountKey]}
726+
</td>
727+
</tr>
695728
)
696-
)
697-
) : (
698-
(addPriceFeed ||
699-
changes.prev[index][priceAccountKey] !==
700-
priceAccount[priceAccountKey]) && (
701-
<tr key={priceAccountKey}>
702-
<td className="base16 py-4 pl-6 pr-2 lg:pl-6">
703-
{priceAccountKey
704-
.split('_')
705-
.map((word) => capitalizeFirstLetter(word))
706-
.join(' ')}
707-
</td>
708-
<td className="base16 py-4 pl-1 pr-2 lg:pl-6">
709-
{!addPriceFeed ? (
710-
<>
711-
<s>{changes.prev[index][priceAccountKey]}</s>
712-
<br />
713-
</>
714-
) : null}
715-
{priceAccount[priceAccountKey]}
716-
</td>
717-
</tr>
718729
)
719730
)
720-
)
721731
)}
722732
</>
723733
)
724734
}
725735

726-
const PublisherKeysChangesRows = ({ changes }: { changes: any }) => {
736+
const PublisherKeysChangesRows = ({ changes }: { changes: any }) => { // eslint-disable-line @typescript-eslint/no-explicit-any
727737
const addPriceFeed = changes.prev === undefined && changes.new !== undefined
728738
const publisherKeysToAdd = addPriceFeed
729739
? changes.new
@@ -765,7 +775,7 @@ const General = ({ proposerServerUrl }: { proposerServerUrl: string }) => {
765775
)
766776
}
767777

768-
const NewPriceFeedsRows = ({ priceFeedData }: { priceFeedData: any }) => {
778+
const NewPriceFeedsRows = ({ priceFeedData }: { priceFeedData: any }) => { // eslint-disable-line @typescript-eslint/no-explicit-any
769779
return (
770780
<>
771781
<MetadataChangesRows
@@ -795,7 +805,7 @@ const General = ({ proposerServerUrl }: { proposerServerUrl: string }) => {
795805
)
796806
}
797807

798-
const ModalContent = ({ changes }: { changes: any }) => {
808+
const ModalContent = ({ changes }: { changes: any }) => { // eslint-disable-line @typescript-eslint/no-explicit-any
799809
return (
800810
<>
801811
{Object.keys(changes).length > 0 ? (

governance/xc_admin/packages/xc_admin_frontend/components/tabs/Proposals/Proposal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ export const Proposal = ({
300300

301301
if (refreshData) await refreshData().fetchData()
302302
toast.success(msg)
303-
} catch (e: any) {
303+
} catch (e: any) { // eslint-disable-line @typescript-eslint/no-explicit-any
304304
toast.error(capitalizeFirstLetter(e.message))
305305
} finally {
306306
setIsTransactionLoading(false)

governance/xc_admin/packages/xc_admin_frontend/components/tabs/UpdatePermissions.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ const UpdatePermissions = () => {
216216
}
217217

218218
const handleEditPubkey = (
219-
e: any,
219+
e: any, // eslint-disable-line @typescript-eslint/no-explicit-any
220220
account: PermissionAccount,
221221
prevPubkey: string
222222
) => {
@@ -280,7 +280,7 @@ const UpdatePermissions = () => {
280280
`Proposal sent! 🚀 Proposal Pubkey: ${proposalPubkey}`
281281
)
282282
setIsSendProposalButtonLoading(false)
283-
} catch (e: any) {
283+
} catch (e: any) { // eslint-disable-line @typescript-eslint/no-explicit-any
284284
toast.error(capitalizeFirstLetter(e.message))
285285
setIsSendProposalButtonLoading(false)
286286
}
@@ -289,7 +289,7 @@ const UpdatePermissions = () => {
289289
}
290290
}
291291

292-
const ModalContent = ({ changes }: { changes: any }) => {
292+
const ModalContent = ({ changes }: { changes: any }) => { // eslint-disable-line @typescript-eslint/no-explicit-any
293293
return (
294294
<>
295295
{Object.keys(changes).length > 0 ? (

0 commit comments

Comments
 (0)