Tried to clear out some eslint warnings (#1937)

This commit is contained in:
Ken-ichi
2024-08-07 17:25:46 -07:00
committed by GitHub
parent 62df19dc8b
commit 0d75473f02
9 changed files with 23 additions and 15 deletions

View File

@@ -1,7 +1,7 @@
version: 2 version: 2
secret: secret:
# Exclude files and paths by globbing # Exclude files and paths by globbing
ignored-paths: ignored_paths:
- '**/README.md' - '**/README.md'
- 'node_modules/*' - 'node_modules/*'
- 'package-lock.json' - 'package-lock.json'

View File

@@ -42,7 +42,7 @@ type Props = {
camera: Object, camera: Object,
device: Object, device: Object,
flipCamera: Function, flipCamera: Function,
handleCheckmarkPress: ( _result: any | null ) => void, handleCheckmarkPress: Function,
isLandscapeMode: boolean isLandscapeMode: boolean
}; };

View File

@@ -6,7 +6,7 @@ interface Props {
showModal: boolean; showModal: boolean;
closeModal: () => void; closeModal: () => void;
// TODO: Param not typed yet, because ExploreLocationSearch is not typed yet // TODO: Param not typed yet, because ExploreLocationSearch is not typed yet
updateLocation: ( _location: any ) => void; updateLocation: ( location: "worldwide" | { name: string } ) => void;
} }
const ExploreLocationSearchModal = ( { const ExploreLocationSearchModal = ( {

View File

@@ -6,7 +6,7 @@ interface Props {
showModal: boolean; showModal: boolean;
closeModal: () => void; closeModal: () => void;
// TODO: Param not typed yet, because ExploreProjectSearch is not typed yet // TODO: Param not typed yet, because ExploreProjectSearch is not typed yet
updateProject: ( _project: any ) => void; updateProject: ( project: null | { title: string } ) => void;
} }
const ExploreProjectSearchModal = ( { const ExploreProjectSearchModal = ( {

View File

@@ -6,7 +6,7 @@ interface Props {
showModal: boolean; showModal: boolean;
closeModal: () => void; closeModal: () => void;
// TODO: Param not typed yet, because ExploreUserSearch is not typed yet // TODO: Param not typed yet, because ExploreUserSearch is not typed yet
updateUser: ( _user: any ) => void; updateUser: ( user: null | { login: string } ) => void;
} }
const ExploreUserSearchModal = ( { const ExploreUserSearchModal = ( {

View File

@@ -50,7 +50,7 @@ import ExploreProjectSearchModal from "./ExploreProjectSearchModal";
import ExploreTaxonSearchModal from "./ExploreTaxonSearchModal"; import ExploreTaxonSearchModal from "./ExploreTaxonSearchModal";
import ExploreUserSearchModal from "./ExploreUserSearchModal"; import ExploreUserSearchModal from "./ExploreUserSearchModal";
const DROP_SHADOW = getShadowForColor( colors.darkGray, { const DROP_SHADOW = getShadowForColor( colors?.darkGray, {
offsetHeight: 4, offsetHeight: 4,
elevation: 6 elevation: 6
} ); } );
@@ -60,13 +60,14 @@ const { useRealm } = RealmContext;
interface Props { interface Props {
closeModal: () => void; closeModal: () => void;
filterByIconicTaxonUnknown: () => void; filterByIconicTaxonUnknown: () => void;
updateTaxon: ( _taxon: Object | null ) => void; // TODO: type this properly when taxon has a type
updateTaxon: ( taxon: null | { name: string } ) => void;
// TODO: Param not typed yet, because ExploreLocationSearch is not typed yet // TODO: Param not typed yet, because ExploreLocationSearch is not typed yet
updateLocation: ( _location: any ) => void; updateLocation: ( location: "worldwide" | { name: string } ) => void;
// TODO: Param not typed yet, because ExploreUserSearch is not typed yet // TODO: Param not typed yet, because ExploreUserSearch is not typed yet
updateUser: ( _user: any ) => void; updateUser: ( user: null | { login: string } ) => void;
// TODO: Param not typed yet, because ExploreProjectSearch is not typed yet // TODO: Param not typed yet, because ExploreProjectSearch is not typed yet
updateProject: ( _project: any ) => void; updateProject: ( project: null | { title: string } ) => void;
} }
const FilterModal = ( { const FilterModal = ( {

View File

@@ -5,8 +5,7 @@ import React from "react";
import { useTheme } from "react-native-paper"; import { useTheme } from "react-native-paper";
interface Props { interface Props {
// TODO: navigation type handleClose?: ( ) => void;
handleClose?: ( _navigation: any ) => void;
black?: boolean; black?: boolean;
buttonClassName?: string; buttonClassName?: string;
size?: number; size?: number;

View File

@@ -3,6 +3,7 @@ import classNames from "classnames";
import { INatIcon, INatIconButton } from "components/SharedComponents"; import { INatIcon, INatIconButton } from "components/SharedComponents";
import { View } from "components/styledComponents"; import { View } from "components/styledComponents";
import React from "react"; import React from "react";
import { TextInput as RNTextInput } from "react-native";
import { TextInput, useTheme } from "react-native-paper"; import { TextInput, useTheme } from "react-native-paper";
import { useTranslation } from "sharedHooks"; import { useTranslation } from "sharedHooks";
import { getShadowForColor } from "styles/global"; import { getShadowForColor } from "styles/global";
@@ -16,8 +17,7 @@ interface Props {
containerClass?: string; containerClass?: string;
handleTextChange: ( _text: string ) => void; handleTextChange: ( _text: string ) => void;
hasShadow?: boolean; hasShadow?: boolean;
// TODO: check react-native-paper docs for correct type input?: React.RefObject<RNTextInput>,
input?: any,
placeholder?: string; placeholder?: string;
testID?: string; testID?: string;
value: string; value: string;

View File

@@ -1,6 +1,7 @@
import { RootStackParamList } from "@react-navigation/native";
// Using typescript with react-native-svg-transformer // Using typescript with react-native-svg-transformer
// from https://www.npmjs.com/package/react-native-svg-transformer?activeTab // from https://www.npmjs.com/package/react-native-svg-transformer?activeTab
declare module "*.svg" { declare module "*.svg" {
import React from "react"; import React from "react";
import { SvgProps } from "react-native-svg"; import { SvgProps } from "react-native-svg";
@@ -8,3 +9,10 @@ declare module "*.svg" {
const content: React.FC<SvgProps>; const content: React.FC<SvgProps>;
export default content; export default content;
} }
declare global {
namespace ReactNavigation {
// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface RootParamList extends RootStackParamList {}
}
}