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
secret:
# Exclude files and paths by globbing
ignored-paths:
ignored_paths:
- '**/README.md'
- 'node_modules/*'
- 'package-lock.json'

View File

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

View File

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

View File

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

View File

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

View File

@@ -50,7 +50,7 @@ import ExploreProjectSearchModal from "./ExploreProjectSearchModal";
import ExploreTaxonSearchModal from "./ExploreTaxonSearchModal";
import ExploreUserSearchModal from "./ExploreUserSearchModal";
const DROP_SHADOW = getShadowForColor( colors.darkGray, {
const DROP_SHADOW = getShadowForColor( colors?.darkGray, {
offsetHeight: 4,
elevation: 6
} );
@@ -60,13 +60,14 @@ const { useRealm } = RealmContext;
interface Props {
closeModal: () => 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
updateLocation: ( _location: any ) => void;
updateLocation: ( location: "worldwide" | { name: string } ) => void;
// 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
updateProject: ( _project: any ) => void;
updateProject: ( project: null | { title: string } ) => void;
}
const FilterModal = ( {

View File

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

View File

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

View File

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