docs: enhance TypeScript standards and remove type suppressions

Strengthens code quality guidelines by establishing strict TypeScript practices that prohibit `any` types and minimize type suppressions.

Updates Copilot instructions to emphasize production-ready code with comprehensive type safety rules, error handling requirements, and reliability standards. Explicitly discourages type escape hatches in favor of proper type definitions.

Refactors navigation implementation to use URLSearchParams instead of object-based params, eliminating the need for type suppression while maintaining functionality.

Removes unnecessary type error suppressions and unused properties throughout codebase, aligning with new standards.
This commit is contained in:
Uruk
2026-01-14 16:27:37 +01:00
parent 895c245254
commit 956eea8848
5 changed files with 43 additions and 16 deletions

View File

@@ -42,18 +42,24 @@ export const TouchableSeerrRouter: React.FC<PropsWithChildren<Props>> = ({
onPress={() => {
if (!result) return;
router.push({
pathname: `/(auth)/(tabs)/${from}/seerr/page`,
// @ts-expect-error
params: {
...result,
mediaTitle,
releaseYear,
canRequest: canRequest.toString(),
posterSrc,
mediaType,
},
// Build URL with query params - avoids Expo Router's strict type checking
const params = new URLSearchParams({
...Object.fromEntries(
Object.entries(result).map(([key, value]) => [
key,
String(value ?? ""),
]),
),
mediaTitle,
releaseYear: releaseYear.toString(),
canRequest: canRequest.toString(),
posterSrc,
mediaType: mediaType.toString(),
});
router.push(
`/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/seerr/page?${params.toString()}`,
);
}}
{...props}
>

View File

@@ -20,7 +20,6 @@ const CastSlide: React.FC<
horizontal
showsHorizontalScrollIndicator={false}
data={details?.credits.cast}
estimatedItemSize={112}
ItemSeparatorComponent={() => <View className='w-2' />}
keyExtractor={(item) => item?.id?.toString() ?? ""}
contentContainerStyle={{ paddingHorizontal: 16 }}

View File

@@ -133,7 +133,7 @@ const ParallaxSlideShow = <T,>({
<View className='px-4'>
<View className='flex flex-row flex-wrap'>
{Array.from({ length: 9 }, (_, i) => (
<GridSkeleton key={i} index={i} />
<GridSkeleton key={i} />
))}
</View>
</View>

View File

@@ -44,7 +44,6 @@ const Slide = <T,>({
data={data}
onEndReachedThreshold={1}
onEndReached={onEndReached}
//@ts-expect-error
renderItem={({ item, index }) =>
item ? renderItem(item, index) : null
}