Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
node_modules/
android/
ios/
dist/
.expo/
Safekeep/
assets/
coverage/
package-lock.json
supabase/functions/
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"singleQuote": true,
"semi": true,
"tabWidth": 2,
"printWidth": 100,
"trailingComma": "es5",
"arrowParens": "always"
}
3 changes: 1 addition & 2 deletions App.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@ import { Ionicons } from '@expo/vector-icons';
import { ThemeProvider, useTheme } from './context/ThemeContext';
import dataRefreshManager from './utils/DataRefreshManager';
import { NotificationService } from './services/NotificationService';
import { UserProvider } from './context/UserContext';
import { UserProvider , useUser } from './context/UserContext';
import SubscriptionService from './services/SubscriptionService';
import { useUser } from './context/UserContext';
import BadgeEarnedModal from './components/shared/BadgeEarnedModal';
import WeeklyReviewModal from './components/shared/WeeklyReviewModal';
import { navigationRef } from './utils/NavigationService';
Expand Down
32 changes: 32 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// https://docs.expo.dev/guides/using-eslint/
const { defineConfig } = require('eslint/config');
const expoConfig = require('eslint-config-expo/flat');
const eslintConfigPrettier = require('eslint-config-prettier');

module.exports = defineConfig([
expoConfig,
// Disable stylistic rules that conflict with Prettier (Prettier owns formatting).
eslintConfigPrettier,
{
ignores: [
'dist/*',
'android/*',
'ios/*',
'.expo/*',
'Safekeep/*',
'scripts/*',
'assets/*',
'supabase/functions/*', // Deno runtime — linted separately, not with the Expo config
],
},
{
rules: {
// Metro/TypeScript resolve these imports (e.g. @expo/vector-icons); the
// import plugin's resolver does not understand RN/Expo module resolution,
// so it produces false positives. Genuinely missing modules fail the build.
'import/no-unresolved': 'off',
// Apostrophes and quotes in JSX copy are fine in React Native UIs.
'react/no-unescaped-entities': 'off',
},
},
]);
10 changes: 5 additions & 5 deletions hooks/useStepCount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { Platform, NativeModules, AppState, AppStateStatus } from 'react-native'
import { supabase } from '../supabaseClient';
import { AchievementService } from '../services/AchievementService';

import { HealthValue, HealthKitPermissions } from 'react-native-health';
import { initialize, requestPermission, readRecords } from 'react-native-health-connect';

// Fix: Use require for CommonJS module + Manual Patch for New Architecture
const AppleHealthKit = require('react-native-health');

Expand All @@ -14,9 +17,6 @@ if (Platform.OS === 'ios' && !AppleHealthKit.initHealthKit && NativeModules.Appl
AppleHealthKit.getSamples = NativeModules.AppleHealthKit.getSamples;
}

import { HealthValue, HealthKitPermissions } from 'react-native-health';
import { initialize, requestPermission, readRecords } from 'react-native-health-connect';

export interface ExternalActivity {
type: string;
duration: number; // in seconds
Expand Down Expand Up @@ -74,7 +74,7 @@ export const useStepCount = (): StepCountData => {
includeManuallyAdded: true,
};

HealthKit.getStepCount(stepOptions, (stepErr: Object, stepResult: HealthValue) => {
HealthKit.getStepCount(stepOptions, (stepErr: object, stepResult: HealthValue) => {
if (!stepErr) {
setSteps(stepResult.value);
}
Expand All @@ -90,7 +90,7 @@ export const useStepCount = (): StepCountData => {

// Use getAnchoredWorkouts for actual HKWorkout objects
if (HealthKit.getAnchoredWorkouts) {
HealthKit.getAnchoredWorkouts(workoutOptions, (workoutErr: Object, response: any) => {
HealthKit.getAnchoredWorkouts(workoutOptions, (workoutErr: object, response: any) => {
// response is { anchor: string, data: [...] } or just [...] depending on version, usually { data: ... }
if (workoutErr) {
console.error('Error fetching workouts (anchored):', workoutErr);
Expand Down
Loading