Skip to content

Commit 52fc042

Browse files
committed
fix: fix deprecations and misused types
This commit fixes places where we were using deprecated APIs or misusing types which can now be caught with our upgraded typescript parser.
1 parent f5c9bb6 commit 52fc042

File tree

9 files changed

+24
-24
lines changed

9 files changed

+24
-24
lines changed

apps/api-reference/src/components/EvmApi/parameter.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ export enum ParameterType {
1313
IntArray,
1414
}
1515

16-
export const TRANSFORMS: {
17-
[paramType in ParameterType]?: (value: string) => unknown;
18-
} = {
16+
export const TRANSFORMS: Partial<
17+
Record<ParameterType, (value: string) => unknown>
18+
> = {
1919
[ParameterType.PriceFeedIdArray]: (value) => [value],
2020
[ParameterType.HexArray]: (value) => [value],
2121
[ParameterType.IntArray]: (value) => [value],

apps/insights/src/omit-keys.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
export const omitKeys = <T extends Record<string, unknown>>(
2-
obj: T,
3-
keys: string[],
4-
) => {
1+
export const omitKeys = (obj: Record<string, unknown>, keys: string[]) => {
52
const omitSet = new Set(keys);
63
return Object.fromEntries(
74
Object.entries(obj).filter(([key]) => !omitSet.has(key)),

apps/staking/src/components/Menu/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
Popover,
1010
Menu as BaseMenu,
1111
MenuItem as BaseMenuItem,
12-
Section as BaseSection,
12+
MenuSection as BaseSection,
1313
Separator as BaseSeparator,
1414
} from "react-aria-components";
1515

apps/staking/tailwind.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ const tailwindConfig = {
1111
forms,
1212
animate,
1313
reactAria,
14-
tailwindPlugin(({ addVariant }) => {
15-
addVariant("search-cancel", "&::-webkit-search-cancel-button");
16-
addVariant("search-decoration", "&::-webkit-search-decoration");
14+
tailwindPlugin((plugin) => {
15+
plugin.addVariant("search-cancel", "&::-webkit-search-cancel-button");
16+
plugin.addVariant("search-decoration", "&::-webkit-search-decoration");
1717
}),
1818
],
1919
theme: {

governance/pyth_staking_sdk/src/utils/position.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export const deserializeStakeAccountPositions = (
7171
) => {
7272
const coder = new BorshCoder(idl);
7373
let i = 8; // Skip discriminator
74-
const owner = new PublicKey(data.slice(i, i + 32));
74+
const owner = new PublicKey(data.subarray(i, i + 32));
7575
const numberOfPositions = Math.floor(
7676
(data.length - POSITIONS_ACCOUNT_HEADER_SIZE) / POSITION_BUFFER_SIZE,
7777
);

packages/component-library/src/Alert/index.stories.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ const meta = {
1919
control: "select",
2020
options: Object.keys(Icon),
2121
mapping: Object.fromEntries(
22-
Object.entries(Icon).map(([key, Icon]) => [key, <Icon key={key} />]),
22+
Object.entries(Icon).map(([key, Icon]) => [
23+
key,
24+
<Icon weights={new Map()} key={key} />,
25+
]),
2326
),
2427
table: {
2528
category: "Contents",

packages/component-library/src/Card/index.stories.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ const meta = {
4141
control: "select",
4242
options: Object.keys(Icon),
4343
mapping: Object.fromEntries(
44-
Object.entries(Icon).map(([key, Icon]) => [key, <Icon key={key} />]),
44+
Object.entries(Icon).map(([key, Icon]) => [
45+
key,
46+
<Icon weights={new Map()} key={key} />,
47+
]),
4548
),
4649
table: {
4750
category: "Contents",

packages/component-library/src/Table/index.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,25 +108,25 @@ export const Table = <T extends string>({
108108
{...props}
109109
>
110110
<TableHeader columns={columns} className={styles.tableHeader ?? ""}>
111-
{(column: ColumnConfig<T>) => (
111+
{(columnConfig: ColumnConfig<T>) => (
112112
<Column
113113
data-sticky-header={stickyHeader === undefined ? undefined : ""}
114-
{...column}
115-
{...cellProps(column, headerCellClassName, {
114+
{...columnConfig}
115+
{...cellProps(columnConfig, headerCellClassName, {
116116
"--sticky-header-top":
117117
typeof stickyHeader === "string" ? stickyHeader : 0,
118118
} as CSSProperties)}
119119
>
120-
{({ allowsSorting, sort, sortDirection }) => (
120+
{({ allowsSorting, sortDirection, ...column }) => (
121121
<>
122-
<div className={styles.name}>{column.name}</div>
122+
<div className={styles.name}>{columnConfig.name}</div>
123123
{allowsSorting && (
124124
<Button
125125
className={styles.sortButton ?? ""}
126126
size="xs"
127127
variant="ghost"
128128
onPress={() => {
129-
sort(
129+
column.sort(
130130
sortDirection === "ascending"
131131
? "descending"
132132
: "ascending",
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
"use client";
22

3-
export {
4-
UNSTABLE_Virtualizer as Virtualizer,
5-
UNSTABLE_ListLayout as ListLayout,
6-
} from "react-aria-components";
3+
export { Virtualizer, ListLayout } from "react-aria-components";

0 commit comments

Comments
 (0)