upgrade typescript to v6
This commit is contained in:
parent
31e46a7435
commit
17011b3739
9 changed files with 25 additions and 49 deletions
32
package-lock.json
generated
32
package-lock.json
generated
|
|
@ -97,7 +97,7 @@
|
|||
"husky": "9.1.7",
|
||||
"lint-staged": "16.3.2",
|
||||
"prettier": "2.8.1",
|
||||
"typescript": "4.9.4",
|
||||
"typescript": "6.0.3",
|
||||
"vite": "5.4.19",
|
||||
"vite-plugin-pwa": "0.20.5",
|
||||
"vite-plugin-static-copy": "1.0.4",
|
||||
|
|
@ -10135,28 +10135,6 @@
|
|||
"node": ">=22.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/matrix-js-sdk/node_modules/@matrix-org/matrix-sdk-crypto-wasm": {
|
||||
"version": "15.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@matrix-org/matrix-sdk-crypto-wasm/-/matrix-sdk-crypto-wasm-15.3.0.tgz",
|
||||
"integrity": "sha512-QyxHvncvkl7nf+tnn92PjQ54gMNV8hMSpiukiDgNrqF6IYwgySTlcSdkPYdw8QjZJ0NR6fnVrNzMec0OohM3wA==",
|
||||
"license": "Apache-2.0",
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
}
|
||||
},
|
||||
"node_modules/matrix-js-sdk/node_modules/uuid": {
|
||||
"version": "11.1.0",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-11.1.0.tgz",
|
||||
"integrity": "sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==",
|
||||
"funding": [
|
||||
"https://github.com/sponsors/broofa",
|
||||
"https://github.com/sponsors/ctavan"
|
||||
],
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"uuid": "dist/esm/bin/uuid"
|
||||
}
|
||||
},
|
||||
"node_modules/matrix-widget-api": {
|
||||
"version": "1.16.1",
|
||||
"resolved": "https://registry.npmjs.org/matrix-widget-api/-/matrix-widget-api-1.16.1.tgz",
|
||||
|
|
@ -12648,9 +12626,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/typescript": {
|
||||
"version": "4.9.4",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.4.tgz",
|
||||
"integrity": "sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==",
|
||||
"version": "6.0.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz",
|
||||
"integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"bin": {
|
||||
|
|
@ -12658,7 +12636,7 @@
|
|||
"tsserver": "bin/tsserver"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4.2.0"
|
||||
"node": ">=14.17"
|
||||
}
|
||||
},
|
||||
"node_modules/ua-parser-js": {
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@
|
|||
"husky": "9.1.7",
|
||||
"lint-staged": "16.3.2",
|
||||
"prettier": "2.8.1",
|
||||
"typescript": "4.9.4",
|
||||
"typescript": "6.0.3",
|
||||
"vite": "5.4.19",
|
||||
"vite-plugin-pwa": "0.20.5",
|
||||
"vite-plugin-static-copy": "1.0.4",
|
||||
|
|
|
|||
|
|
@ -59,10 +59,7 @@ function GlobalPackSelector({
|
|||
const ct = useClient();
|
||||
|
||||
const imagePackRooms = useMemo(
|
||||
() =>
|
||||
packs
|
||||
.map((pack) => pack.address?.roomId)
|
||||
.filter((rId): rId is string => typeof rId === 'string'),
|
||||
() => packs.map((pack) => pack.address?.roomId).filter((rId) => typeof rId === 'string'),
|
||||
[packs]
|
||||
);
|
||||
const [getRoomHeroes, roomToHeroMembersResult] = useRoomHeroes(imagePackRooms);
|
||||
|
|
@ -153,7 +150,7 @@ function GlobalPackSelector({
|
|||
|
||||
const roomPackAddresses = roomPacks
|
||||
.map((pack) => pack.address)
|
||||
.filter((addr): addr is PackAddress => addr !== undefined);
|
||||
.filter((addr) => addr !== undefined);
|
||||
|
||||
const allSelected = roomPackAddresses.every((addr) =>
|
||||
selected.find((address) => packAddressEqual(addr, address))
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ export const useGlobalImagePacks = (): PendingObservableResult<ImagePack[]> => {
|
|||
useCallback(
|
||||
(roomPackEvents) =>
|
||||
roomPackEvents
|
||||
.filter((p): p is JoinRoomStateObject => !!p)
|
||||
.filter((p) => !!p)
|
||||
.map((packEvent) => ImagePack.fromStateEvent(packEvent.roomId, packEvent.event)),
|
||||
[]
|
||||
)
|
||||
|
|
@ -150,7 +150,7 @@ export const useRoomsImagePacks = (rooms: string[]): PendingObservableResult<Ima
|
|||
useCallback(
|
||||
(roomPackEvents) =>
|
||||
roomPackEvents
|
||||
.filter((p): p is JoinRoomStateObject => !!p)
|
||||
.filter((p) => !!p)
|
||||
.map((roomPackEvent) =>
|
||||
ImagePack.fromStateEvent(roomPackEvent.roomId, roomPackEvent.event)
|
||||
),
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ export const usePublishedAliases = (roomId: string): [string | undefined, string
|
|||
|
||||
const alias = ObjectReader.string(content, 'alias');
|
||||
const altAliases = ObjectReader.array(content, 'alt_aliases')?.filter(
|
||||
(a): a is string => typeof a === 'string'
|
||||
(a) => typeof a === 'string'
|
||||
);
|
||||
|
||||
const publishedAliases = useMemo(() => {
|
||||
|
|
|
|||
|
|
@ -672,8 +672,7 @@ export function Invites() {
|
|||
const known: InviteData[] = [];
|
||||
const unknown: InviteData[] = [];
|
||||
const spam: InviteData[] = [];
|
||||
const senderMembers =
|
||||
senderMemberResult.value?.filter((m): m is JoinRoomMemberObject => !!m) ?? [];
|
||||
const senderMembers = senderMemberResult.value?.filter((m) => !!m) ?? [];
|
||||
|
||||
invitesData?.forEach((invite) => {
|
||||
const senderMemberEvents = senderMembers.filter((m) => m.userId === invite.senderId);
|
||||
|
|
|
|||
|
|
@ -2,9 +2,7 @@ import { ObjectReader } from 'neurone/lib/utils';
|
|||
|
||||
export class rMentions {
|
||||
static userIds(mentions?: object): string[] | undefined {
|
||||
return ObjectReader.array(mentions, 'user_ids')?.filter(
|
||||
(id): id is string => typeof id === 'string'
|
||||
);
|
||||
return ObjectReader.array(mentions, 'user_ids')?.filter((id) => typeof id === 'string');
|
||||
}
|
||||
|
||||
static room(mentions?: object): boolean | undefined {
|
||||
|
|
|
|||
|
|
@ -48,6 +48,6 @@ export class LocalEventOutbox {
|
|||
public getSentEventIds(): string[] {
|
||||
return this.items
|
||||
.map((s) => (s.state.read instanceof EventSenderSuccess ? s.state.read.eventId : undefined))
|
||||
.filter<string>((eId): eId is string => typeof eId === 'string');
|
||||
.filter<string>((eId) => typeof eId === 'string');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,17 +1,21 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"sourceMap": true,
|
||||
"rootDir": "./src",
|
||||
"outDir": "./dist",
|
||||
|
||||
"target": "ES2022",
|
||||
"module": "ES2022",
|
||||
"lib": ["ES2022", "DOM"],
|
||||
|
||||
"jsx": "react",
|
||||
"target": "ES2016",
|
||||
"module": "ES2020",
|
||||
"moduleResolution": "bundler",
|
||||
|
||||
"sourceMap": true,
|
||||
"allowJs": true,
|
||||
"strict": true,
|
||||
"esModuleInterop": true,
|
||||
"moduleResolution": "Node",
|
||||
"resolveJsonModule": true,
|
||||
"outDir": "dist",
|
||||
"skipLibCheck": true,
|
||||
"lib": ["ES2016", "DOM"]
|
||||
"skipLibCheck": true
|
||||
},
|
||||
"exclude": ["node_modules", "dist"],
|
||||
"include": ["src"]
|
||||
|
|
|
|||
Loading…
Reference in a new issue