MOB-1039 demonstrate stylistic rule w/ autofix test

This commit is contained in:
Ryan Stelly
2025-12-04 15:58:26 -06:00
parent 85ca67fbe0
commit 581023738d
101 changed files with 110 additions and 110 deletions

View File

@@ -24,7 +24,7 @@ type ObsCreateItem = {
testID: string,
accessibilityLabel: string,
accessibilityHint: string
}
};
const majorVersionIOS = parseInt( String( Platform.Version ), 10 );
const AI_CAMERA_SUPPORTED = ( Platform.OS === "ios" && majorVersionIOS >= 11 )

View File

@@ -16,7 +16,7 @@ type Props = {
photosTaken: boolean,
rotatableAnimatedStyle: Object,
takePhoto: ( ) => void,
}
};
const CameraNavButtons = ( {
disabled,

View File

@@ -26,7 +26,7 @@ type Props = {
takePhotoOptions: Object,
zoomTextValue: string,
showZoomButton: boolean
}
};
const CameraOptionsButtons = ( {
takePhoto,

View File

@@ -11,7 +11,7 @@ type Props = {
setShowDiscardSheet: Function,
hidden?: boolean,
onDiscard: Function
}
};
const DiscardChangesSheet = ( {
setShowDiscardSheet,

View File

@@ -7,7 +7,7 @@ const logger = log.extend( "CameraView" );
type Event = {
log: string;
}
};
const handleClassifierError = ( error: CameraRuntimeError ) => {
// When we hit this error, there is an error with the classifier.

View File

@@ -13,7 +13,7 @@ import RNFS from "react-native-fs";
export type DirectoryEntrySize = {
name: string;
size: number;
}
};
// https://stackoverflow.com/questions/15900485/correct-way-to-convert-size-in-bytes-to-kb-mb-gb-in-javascript
export function formatSizeUnits( bytes: number ) {
@@ -122,7 +122,7 @@ export function getTotalDirectorySize( directoryItems: DirectoryEntrySize[] ): n
type AppSize = {
[directoryName: string]: DirectoryEntrySize[]
}
};
async function fetchAppSize(): Promise<AppSize> {
const maybeExistingDirectories = await Promise.all(

View File

@@ -66,7 +66,7 @@ type Props = {
updateProject: Function,
updateTaxon: Function,
updateUser: Function
}
};
const Explore = ( {
canFetch,

View File

@@ -35,7 +35,7 @@ type Props = {
requestLocationPermissions: Function,
updateLocation: Function,
updateTaxon: Function
}
};
const Header = ( {
count,

View File

@@ -17,7 +17,7 @@ type Props = {
exploreViewIcon: string,
isFetching: boolean,
onPress: Function,
}
};
const ExploreHeaderCount = ( {
count,

View File

@@ -31,7 +31,7 @@ type Props = {
hasLocationPermissions?: boolean,
renderLocationPermissionsGate: Function,
requestLocationPermissions: Function
}
};
const OBS_LIST_CONTAINER_STYLE = { paddingTop: 50 };

View File

@@ -24,7 +24,7 @@ type Props = {
isConnected: boolean,
queryParams: Object,
handleUpdateCount: Function
}
};
const SpeciesView = ( {
canFetch,

View File

@@ -59,18 +59,18 @@ type FullPageWebViewParams = {
skipSetSourceInShouldStartLoadWithRequest?: boolean;
clickablePathnames?: Array<string>;
shouldLoadUrl?: ( url: string ) => boolean;
}
};
type ParamList = {
FullPageWebView: FullPageWebViewParams
}
};
type WebViewSource = {
uri: string;
headers?: {
Authorization?: string | null
}
}
};
export function onShouldStartLoadWithRequest(
request: ShouldStartLoadRequest,

View File

@@ -18,7 +18,7 @@ import LoginSignUpInputField from "./LoginSignUpInputField";
type Props = {
reset: ( email: string ) => Promise<void>,
scrollViewRef?: { current: null | ElementRef<typeof ScrollView> },
}
};
const ForgotPasswordForm = ( { reset, scrollViewRef }: Props ): Node => {
const [email, setEmail] = useState( "" );

View File

@@ -39,7 +39,7 @@ interface LoginFormParams {
type ParamList = {
LoginFormParams: LoginFormParams
}
};
const LoginForm = ( {
scrollViewRef

View File

@@ -21,7 +21,7 @@ type Props = {
testID?: string,
updateMaxHeight?: ( height: number ) => void,
forcedHeight: number
}
};
const SuggestionsResult = ( {
confidence,

View File

@@ -19,7 +19,7 @@ type Props = {
taxon: RealmTaxon | ApiTaxon,
testID?: string,
selected?: boolean
}
};
const IconicSuggestion = ( {
fetchRemote = true,

View File

@@ -38,7 +38,7 @@ type Props = {
scrollRef: Object,
iconicTaxon: Object,
setIconicTaxon: ( ) => void
}
};
const Match = ( {
observation,

View File

@@ -16,7 +16,7 @@ type Props = {
taxon: Object,
obsPhotos: Array<Object>,
navToTaxonDetails: ( photo: Object ) => void
}
};
const PhotosSection = ( {
representativePhoto,

View File

@@ -14,7 +14,7 @@ const DROP_SHADOW = getShadow( {
type Props = {
handlePress: Function
}
};
const SaveDiscardButtons = ( {
handlePress

View File

@@ -43,7 +43,7 @@ type Props = {
}>,
selectedMediaIndex: number,
setSelectedMediaIndex: Function
}
};
const MainMediaDisplay = ( {
autoPlaySound,

View File

@@ -25,7 +25,7 @@ type Props = {
sounds?: Array<{
file_url: string
}>,
}
};
const SMALL_ITEM_CLASS = "rounded-sm w-[42px] h-[42px] mx-[6px] my-[12px]";
const LARGE_ITEM_CLASS = "rounded-md w-[83px] h-[83px] mx-[10px] my-[20px]";

View File

@@ -41,7 +41,7 @@ type Props = {
file_url: string
}>,
uri?: string | null
}
};
const MediaViewer = ( {
autoPlaySound,

View File

@@ -26,7 +26,7 @@ type Props = {
}>,
showModal: boolean,
uri?: string | null
}
};
const MediaViewerModal = ( {
autoPlaySound,

View File

@@ -44,7 +44,7 @@ const AutoheightWebView = ( webshellProps ): Node => {
type Props = {
isConnected: boolean
}
};
const Announcements = ( {
isConnected

View File

@@ -19,7 +19,7 @@ const DROP_SHADOW = getShadow( {
type Props = {
currentUser: RealmUser | null;
}
};
const LoginBanner = ( {
currentUser

View File

@@ -25,7 +25,7 @@ type Props = {
styling: string
},
stopAllUploads: Function
}
};
const SimpleUploadBanner = ( {
error,

View File

@@ -27,7 +27,7 @@ type Props = {
numUploadableObservations: number,
handleSyncButtonPress: Function,
currentUser: Object
}
};
const SimpleUploadBannerContainer = ( {
handleSyncButtonPress,

View File

@@ -29,7 +29,7 @@ type Props = {
geoprivacy: string,
taxonGeoprivacy: string,
belongsToCurrentUser: boolean
}
};
const ActivityHeader = ( {
classNameMargin,

View File

@@ -18,7 +18,7 @@ type Props = {
geoprivacy: string,
taxonGeoprivacy: string,
belongsToCurrentUser: boolean
}
};
const ActivityHeaderContainer = ( {
classNameMargin,

View File

@@ -15,7 +15,7 @@ type Props = {
setShowEditCommentSheet: Function,
setShowWithdrawIDSheet: Function,
updateIdentification: Function,
}
};
const ActivityItemKebabMenu = ( {
current,

View File

@@ -27,7 +27,7 @@ type Props = {
geoprivacy: string,
taxonGeoprivacy: string,
belongsToCurrentUser: boolean
}
};
const ActivityItem = ( {
currentUserId,

View File

@@ -17,7 +17,7 @@ type Props = {
targetItemID: number,
// TODO change to LayoutEvent from react-native if/when switching to TS
onLayoutTargetItem: ( event: Object ) => void
}
};
const ActivityTab = ( {
observation,

View File

@@ -19,7 +19,7 @@ type Props = {
navToSuggestions: Function,
showAddCommentSheet: Function,
openAddCommentSheet: Function
}
};
const FloatingButtons = ( {
navToSuggestions,

View File

@@ -54,7 +54,7 @@ type Props = {
removeNeedsIDVote: Function,
setMetricVote: Function,
setNeedsIDVote: Function,
}
};
const DataQualityAssessment = ( {
checkTest,

View File

@@ -18,7 +18,7 @@ type Props = {
loadingMetric: ?string,
setVote: Function,
removeVote: Function
}
};
const getUserVote = ( currentUser, metric, votes ) => {
if ( votes && votes.length > 0 ) {

View File

@@ -12,7 +12,7 @@ import ObscurationExplanation from "./ObscurationExplanation";
type Props = {
currentUser: { id: number },
observation: Object
}
};
const DetailsMapHeader = ( {
currentUser,

View File

@@ -27,7 +27,7 @@ import ProjectSection from "./ProjectSection";
type Props = {
currentUser: Object,
observation: Object
}
};
const OBSERVATION_URL = "https://www.inaturalist.org/observations";

View File

@@ -22,7 +22,7 @@ type Props = {
currentUser?: Object,
afterToggleFave: Function,
top?: boolean
}
};
const FaveButton = ( {
observation,

View File

@@ -73,7 +73,7 @@ type Props = {
},
onChangeIdentBody?: Function,
uuid: string
}
};
const ObsDetails = ( {
activityItems,

View File

@@ -20,7 +20,7 @@ type Props = {
belongsToCurrentUser: boolean,
isConnected: boolean,
observation: Object,
}
};
const ObsDetailsOverview = ( {
belongsToCurrentUser,

View File

@@ -23,7 +23,7 @@ type Props = {
file_url: string
}>,
tablet: boolean
}
};
const ObsMedia = ( {
loading,

View File

@@ -19,7 +19,7 @@ type Props = {
photos: Array<Object>,
sounds: Array<Object>,
tablet: boolean
}
};
const ObsMediaDisplay = ( {
loading,

View File

@@ -8,7 +8,7 @@ import ObsMediaDisplay from "./ObsMediaDisplay";
type Props = {
observation: Object,
tablet?: boolean
}
};
// TODO replace this hack. Without this you get errors about the
// photo objects being invalidated down in ObsMedia, but the

View File

@@ -22,7 +22,7 @@ type Props = {
},
onAgree:Function,
onPressClose: Function,
}
};
const showTaxon = taxon => {
if ( !taxon ) {

View File

@@ -14,7 +14,7 @@ type Props = {
onPressClose: Function,
updateIdentification: Function,
taxon: Object
}
};
const showTaxon = taxon => {
if ( !taxon ) {

View File

@@ -29,7 +29,7 @@ type Props = {
geoprivacy: string,
taxonGeoprivacy: string,
belongsToCurrentUser: boolean
}
};
const ActivityHeader = ( {
classNameMargin,

View File

@@ -18,7 +18,7 @@ type Props = {
geoprivacy: string,
taxonGeoprivacy: string,
belongsToCurrentUser: boolean
}
};
const ActivityHeaderContainer = ( {
classNameMargin,

View File

@@ -29,7 +29,7 @@ type Props = {
taxonGeoprivacy: string,
belongsToCurrentUser: boolean,
showExplainerText: boolean
}
};
const ActivityItem = ( {
currentUserId,

View File

@@ -17,7 +17,7 @@ type Props = {
targetItemID: number,
// TODO change to LayoutEvent from react-native if/when switching to TS
onLayoutTargetItem: ( event: Object ) => void
}
};
const CommunitySection = ( {
observation,

View File

@@ -19,7 +19,7 @@ type Props = {
navToSuggestions: Function,
showAddCommentSheet: Function,
openAddCommentSheet: Function
}
};
const FloatingButtons = ( {
navToSuggestions,

View File

@@ -20,7 +20,7 @@ type Props = {
belongsToCurrentUser: boolean,
isSimpleMode: boolean,
observation: Object,
}
};
const CommunityTaxon = ( {
belongsToCurrentUser,

View File

@@ -7,7 +7,7 @@ import React from "react";
type Props = {
observation: Object
}
};
const renderRestrictions = ( licenseCode: string ) => {
switch ( licenseCode ) {

View File

@@ -17,7 +17,7 @@ import GeoprivacyStatus from "./GeoprivacyStatus";
type Props = {
observation: Object
}
};
const DetailsSection = ( { observation }: Props ): Node => {
const application = observation?.application?.name;

View File

@@ -17,7 +17,7 @@ type Props = {
uuid: string,
refetchSubscriptions: Function,
subscriptions: Object
}
};
const HeaderKebabMenu = ( {
observationId,

View File

@@ -13,7 +13,7 @@ import React from "react";
type Props = {
currentUser: { id: number },
observation: Object
}
};
const DetailsMapHeader = ( {
currentUser,

View File

@@ -15,7 +15,7 @@ import ViewInBrowserButton from "./ViewInBrowserButton";
type Props = {
observation: Object
}
};
const MoreSection = ( { observation }: Props ): Node => {
const observationUUID = observation?.uuid;

View File

@@ -8,7 +8,7 @@ import { Alert, Platform, Share } from "react-native";
type Props = {
id: number
}
};
const OBSERVATION_URL = "https://www.inaturalist.org/observations";

View File

@@ -44,7 +44,7 @@ type Props = {
targetActivityItemID: number,
wasSynced: boolean,
uuid: string
}
};
const ObsDetailsDefaultMode = ( {
activityItems = [],

View File

@@ -21,7 +21,7 @@ type Props = {
sounds?: Array<{
file_url: string
}>
}
};
const ObsMedia = ( {
loading,

View File

@@ -18,7 +18,7 @@ type Props = {
loading: boolean,
photos: Array<Object>,
sounds: Array<Object>
}
};
const ObsMediaDisplay = ( {
loading,

View File

@@ -7,7 +7,7 @@ import ObsMediaDisplay from "./ObsMediaDisplay";
type Props = {
observation: Object
}
};
// TODO replace this hack. Without this you get errors about the
// photo objects being invalidated down in ObsMedia, but the

View File

@@ -12,7 +12,7 @@ type Props = {
belongsToCurrentUser: boolean,
isConnected: boolean,
observation: Object,
}
};
const ObserverDetails = ( {
belongsToCurrentUser,

View File

@@ -22,7 +22,7 @@ type Props = {
},
onAgree:Function,
onPressClose: Function,
}
};
const showTaxon = taxon => {
if ( !taxon ) {

View File

@@ -12,7 +12,7 @@ import React from "react";
type Props = {
observation: Object
}
};
const StatusSection = ( { observation }: Props ): Node => {
if ( !observation ) return null;

View File

@@ -28,7 +28,7 @@ type Props = {
showFocusedUploadButton: boolean
showHalfOpacity: boolean,
wasSynced: boolean,
}
};
const BottomButtons = ( {
buttonPressed,

View File

@@ -29,7 +29,7 @@ type Props = {
setCurrentObservationIndex: Function,
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
transitionAnimation: Function
}
};
const BottomButtonsContainer = ( {
passesEvidenceTest,

View File

@@ -34,7 +34,7 @@ type Props = {
},
uuid: string
}>
}
};
const EvidenceList = ( {
handleAddEvidence,

View File

@@ -34,7 +34,7 @@ type Props = {
}>,
onLocationPress: ( ) => void,
updateObservationKeys: Function
}
};
const EvidenceSection = ( {
currentObservation,

View File

@@ -26,7 +26,7 @@ type Props = {
passesEvidenceTest: boolean,
setPassesEvidenceTest: Function,
updateObservationKeys: Function
}
};
const EvidenceSectionContainer = ( {
currentObservation,

View File

@@ -24,7 +24,7 @@ type Props = {
resetScreen: boolean,
setResetScreen: Function,
updateObservationKeys: Function
}
};
const IdentificationSection = ( {
currentObservation,

View File

@@ -14,7 +14,7 @@ type Props = {
setResetScreen: Function,
transitionAnimation: Function,
transitionAnimationRef: Object
}
};
const MultipleObservationsArrows = ( {
currentObservationIndex,

View File

@@ -23,7 +23,7 @@ const { useRealm } = RealmContext;
type Props = {
observations: Array<Object>,
currentObservation: Object
}
};
const ObsEditHeader = ( {
observations,

View File

@@ -15,7 +15,7 @@ import WildStatusSheet from "./Sheets/WildStatusSheet";
type Props = {
currentObservation: Object,
updateObservationKeys: Function
}
};
const OtherDataSection = ( {
currentObservation,

View File

@@ -13,7 +13,7 @@ type Props = {
disableAddingMoreEvidence: boolean,
hidden?: boolean,
onClose: Function
}
};
const AddEvidenceSheet = ( {
disableAddingMoreEvidence,

View File

@@ -18,7 +18,7 @@ type Props = {
observations: Array<Object>,
onDelete?: Function,
updateObservations: Function
}
};
const DeleteObservationSheet = ( {
currentObservation,

View File

@@ -10,7 +10,7 @@ import React from "react";
type Props = {
onPressClose: Function,
discardChanges: Function
}
};
const DiscardChangesSheet = ( {
onPressClose,

View File

@@ -17,7 +17,7 @@ type Props = {
discardObservation: Function,
observations: Array<Object>,
onSave?: Function
}
};
const DiscardObservationSheet = ( {
onPressClose,

View File

@@ -15,7 +15,7 @@ type Props = {
onPressClose: ( ) => void,
selectedValue?: Geoprivacy,
updateGeoprivacyStatus: ( Geoprivacy ) => void
}
};
const GeoprivacySheet = ( {
onPressClose,

View File

@@ -8,7 +8,7 @@ import useTranslation from "sharedHooks/useTranslation";
type Props = {
setShowImpreciseLocationSheet: Function
}
};
const ImpreciseLocationSheet = ( { setShowImpreciseLocationSheet }: Props ): Node => {
const { t } = useTranslation( );

View File

@@ -9,7 +9,7 @@ import useTranslation from "sharedHooks/useTranslation";
type Props = {
setShowMissingEvidenceSheet: Function
}
};
const MissingEvidenceSheet = ( { setShowMissingEvidenceSheet }: Props ): Node => {
const { t } = useTranslation( );

View File

@@ -11,7 +11,7 @@ type Props = {
onPressClose: Function,
selectedValue: boolean,
updateCaptiveStatus: Function
}
};
const WildStatusSheet = ( {
onPressClose,

View File

@@ -10,7 +10,7 @@ type Props = {
selectedObservations: Array<Object>,
selectObservationPhotos: Function,
style?: Object
}
};
const GroupPhotoImage = ( {
item,

View File

@@ -31,7 +31,7 @@ type Props = {
selectObservationPhotos: Function,
separatePhotos: Function,
totalPhotos: number
}
};
const GroupPhotos = ( {
combinePhotos,

View File

@@ -42,7 +42,7 @@ type Props = {
joinProject: Function,
leaveProject: Function,
loadingProjectMembership: boolean
}
};
const ProjectDetails = ( {
project, joinProject, leaveProject, loadingProjectMembership

View File

@@ -19,7 +19,7 @@ type LocalesResponse = Array<{
type Props = {
onChange: ( newLocale: string ) => void;
}
};
const LanguageSetting = ( { onChange }: Props ) => {
const { t, i18n } = useTranslation();

View File

@@ -26,7 +26,7 @@ type NameDisplayPref =
type Props = {
onChange: ( options: TaxonNamesSettings ) => void;
}
};
const TaxonNamesSetting = ( { onChange }: Props ) => {
const realm = useRealm( );

View File

@@ -23,14 +23,14 @@ import colors from "styles/tailwindColors";
type ConfettiProps = PropsWithChildren<{
count: number
duration?: number
}>
}>;
type AnimatedElementProps = PropsWithChildren<{
index: number
count: number
animation: SharedValue<number>
duration: number
}>
}>;
const AnimatedElement = memo(
( {

View File

@@ -12,7 +12,7 @@ type Props = {
value: string | number;
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
ValueComponent?: Function;
}
};
const LabelColonValue = ( {
label,

View File

@@ -13,13 +13,13 @@ type Props = {
onObservationPressed: Function,
onSpeciesPressed: Function,
onMembersPressed: Function
}
};
type CountProps = {
count: number,
icon: string,
label: string
}
};
type CountPressableProps = {
accessibilityLabel: string,
@@ -27,7 +27,7 @@ type CountPressableProps = {
icon: string,
label: string,
onPress?: Function
}
};
const Count = ( {
count, label, icon

View File

@@ -9,7 +9,7 @@ import React from "react";
type Props = {
props: BottomSheetBackdropProps,
onPress: ( ) => void
}
};
const BottomSheetStandardBackdrop = ( { props, onPress }: Props ) => (
<BottomSheetBackdrop

View File

@@ -30,7 +30,7 @@ type Props = {
maxLength?: number,
placeholder?: string,
textInputStyle?: Object
}
};
const CharLimit = ( { current = 0, limit = 1, t } ) => {
let currentColor = "text-darkGrayDisabled";

View File

@@ -7,7 +7,7 @@ const PROGRESS_BAR_STYLE = { backgroundColor: "transparent" };
type Props = {
progress: number
}
};
const UploadProgressBar = ( { progress }: Props ): Node => (
<ProgressBar

View File

@@ -10,7 +10,7 @@ type Props = {
layout: "horizontal" | "vertical";
fadeInIcon: ReactComponent;
fadeOutIcon: ReactComponent;
}
};
const AnimatedView = Reanimated.createAnimatedComponent( View );
const keyframe = new Keyframe( {

View File

@@ -6,7 +6,7 @@ import React from "react";
type Props = {
iconClasses: Array<string>,
completeColor: string
}
};
const UploadCompleteIcon = ( {
iconClasses,

View File

@@ -10,7 +10,7 @@ type Props = {
progress: number;
iconClasses: Array<string>;
uniqueKey?: string;
}
};
const UploadProgressIcon = ( {
color,

View File

@@ -11,7 +11,7 @@ type FlattenUploadArgs = {
name: string,
type: string
}
}
};
const flattenUploadParams = async (
uri: string

View File

@@ -28,7 +28,7 @@ type Props = {
licenseCode?: string
}>,
tablet: boolean
}
};
const TaxonMedia = ( {
loading,

View File

@@ -176,7 +176,7 @@ interface DefaultLocation {
radius?: number
}
type ExploreProviderProps = {children: React.ReactNode}
type ExploreProviderProps = {children: React.ReactNode};
type State = {
casual: boolean,
created_d1: string | null | undefined,
@@ -225,7 +225,7 @@ type State = {
excludeUser: object | undefined | null,
verifiable: boolean,
wildStatus: WILD_STATUS
}
};
type Action = {type: EXPLORE_ACTION.RESET}
| {type: EXPLORE_ACTION.DISCARD, snapshot: State}
| {type: EXPLORE_ACTION.SET_USER, user: object | null, userId: number | null, storedState: State}
@@ -284,8 +284,8 @@ type Action = {type: EXPLORE_ACTION.RESET}
| {type: EXPLORE_ACTION.SET_REVIEWED, reviewedFilter: REVIEWED}
| {type: EXPLORE_ACTION.SET_PHOTO_LICENSE, photoLicense: PHOTO_LICENSE}
| {type: EXPLORE_ACTION.SET_MAP_BOUNDARIES, mapBoundaries: MapBoundaries}
| {type: EXPLORE_ACTION.USE_STORED_STATE, storedState: State}
type Dispatch = ( action: Action ) => void
| {type: EXPLORE_ACTION.USE_STORED_STATE, storedState: State};
type Dispatch = ( action: Action ) => void;
const ExploreContext = React.createContext<
{

View File

@@ -100,7 +100,7 @@ export type License =
| "cc-by-sa"
| "cc-by-nc-nd"
| "cc-by-nc-sa"
| "cc0"
| "cc0";
export interface RealmObservationPojo {
_created_at?: Date;

View File

@@ -5,7 +5,7 @@ import { log } from "sharedHelpers/logger";
const logger = log.extend( "tracking.ts" );
type FirebaseParameters = Record<string, string | number | string[]>
type FirebaseParameters = Record<string, string | number | string[]>;
export const logFirebaseEvent = (
eventId: string,

Some files were not shown because too many files have changed in this diff Show More