Skip to content

Commit 38fb695

Browse files
authored
Merge pull request #10 from loqtek/upgrade/expo54AndLinting
upgrade to expo 54; added linting action upgraded all deps upgraded to expo 54 added github action for auto linting
2 parents 30091ed + 4f57c22 commit 38fb695

19 files changed

Lines changed: 136 additions & 76 deletions

File tree

.github/workflows/lint-check.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Lint Auto Check
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- staging
8+
- dev
9+
10+
permissions:
11+
contents: read
12+
pull-requests: write
13+
14+
jobs:
15+
lint:
16+
name: Run Lint Auto Checks
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
# Checkout to repo
21+
- name: Checkout code
22+
uses: actions/checkout@v4
23+
24+
# Install Bun
25+
- name: Setup Bun
26+
uses: oven-sh/setup-bun@v1
27+
with:
28+
bun-version: latest
29+
30+
# Install deps
31+
- name: Install dependencies
32+
run: bun install
33+
34+
# Run ESLint check
35+
- name: Run ESLint
36+
id: lint
37+
run: bun run lint
38+
39+
# Comment on PR if lint fails
40+
- name: Comment on PR if lint fails
41+
if: failure()
42+
uses: marocchino/sticky-pull-request-comment@v2
43+
with:
44+
message: |
45+
```diff
46+
==================================================
47+
|| ⚠️ ESLint Checks Failed! ❌ ||
48+
==================================================
49+
```
50+
Please review the errors and fix them **before requesting a review.**
51+
52+
**Tips:**
53+
- Run `bun run lint` locally to see detailed issues.
54+
- Commit fixes, push again, and this check will re-run automatically.
55+
56+
# Comment on PR if lint passes
57+
- name: Comment on PR if lint passes
58+
if: success()
59+
uses: marocchino/sticky-pull-request-comment@v2
60+
with:
61+
message: |
62+
```ini
63+
==================================================
64+
|| ✅ ESLint Checks Passed! 🎉 ||
65+
==================================================
66+
```
67+
All linting checks completed successfully. You can now request a review.

app.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"expo": {
33
"name": "Scale Manager",
44
"slug": "scaleManager",
5-
"version": "1.2.2",
5+
"version": "1.2.3",
66
"orientation": "portrait",
77
"icon": "./assets/images/noBgScaleManagerLogo.png",
88
"scheme": "myapp",
@@ -39,7 +39,9 @@
3939
"resizeMode": "contain",
4040
"backgroundColor": "#ffffff"
4141
}
42-
]
42+
],
43+
"expo-font",
44+
"expo-web-browser"
4345
],
4446
"experiments": {
4547
"typedRoutes": true

app/(tabs)/_layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default function TabLayout() {
1212
useEffect(() => {
1313
async function checkVersion() {
1414
const serverConf = await getServerConfig();
15-
if (serverConf?.version && serverConf.version == "0.26") {
15+
if (serverConf?.version && serverConf.version === "0.26") {
1616
setHideRoutes(true);
1717
}
1818
}

app/(tabs)/acl.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,13 @@ export default function ACLScreen() {
1818
const {
1919
// State
2020
policy,
21-
originalPolicy,
2221
loading,
2322
saving,
2423
policyVersions,
2524
showVersions,
2625
editing,
2726
editText,
2827
showSetupGuide,
29-
showErrorModal,
30-
currentError,
3128

3229
// Actions
3330
fetchPolicy,
@@ -41,8 +38,6 @@ export default function ACLScreen() {
4138
// Modal controls
4239
setShowVersions,
4340
setShowSetupGuide,
44-
setShowErrorModal,
45-
setCurrentError,
4641
setEditText,
4742
} = useACL();
4843

app/(tabs)/apikeys.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { MaterialIcons } from "@expo/vector-icons";
88
import Toast from "react-native-toast-message";
99
import { useApiKeys } from "@/app/funcs/apikeys";
1010

11-
export default function apiKeysScreen() {
11+
export default function ApiKeysScreen() {
1212
const {
1313
apiKeys,
1414
newKeyExpire,
@@ -26,7 +26,7 @@ export default function apiKeysScreen() {
2626

2727
useEffect(() => {
2828
fetchApiKeys();
29-
}, []);
29+
}, [fetchApiKeys]);
3030

3131
const handleCreateKeyWithDisplay = async () => {
3232
const result = await handleCreateKey();
@@ -69,8 +69,8 @@ export default function apiKeysScreen() {
6969
visible={showKeyModal}
7070
onRequestClose={closeKeyModal}
7171
>
72-
<View className="flex-1 justify-center items-center px-4">
73-
<View className="bg-zinc-800 rounded-2xl p-6 w-full max-w-md">
72+
<View className="flex-1 justify-center items-center px-4 bg-black/50">
73+
<View className="bg-zinc-800 rounded-2xl p-6 w-full max-w-md shadow-2xl">
7474
<View className="items-center mb-4">
7575
<MaterialIcons name="vpn-key" size={48} color="#10b981" />
7676
<Text className="text-white text-xl font-bold mt-2">
@@ -91,6 +91,7 @@ export default function apiKeysScreen() {
9191
<TouchableOpacity
9292
onPress={() => copyToClipboard(newApiKey!)}
9393
className="flex-1 bg-blue-600 py-3 rounded-lg flex-row items-center justify-center"
94+
activeOpacity={0.7}
9495
>
9596
<MaterialIcons name="content-copy" size={18} color="white" />
9697
<Text className="text-white font-semibold ml-2">Copy Key</Text>
@@ -99,6 +100,7 @@ export default function apiKeysScreen() {
99100
<TouchableOpacity
100101
onPress={closeKeyModal}
101102
className="flex-1 bg-zinc-600 py-3 rounded-lg"
103+
activeOpacity={0.7}
102104
>
103105
<Text className="text-white font-semibold text-center">Done</Text>
104106
</TouchableOpacity>
@@ -113,7 +115,7 @@ export default function apiKeysScreen() {
113115
);
114116

115117
return (
116-
<SafeAreaView className="flex-1 bg-zinc-900 px-4 pt-4">
118+
<SafeAreaView className="flex-1 bg-zinc-900">
117119
{loading ? (
118120
<View className="flex-1 justify-center items-center">
119121
<ActivityIndicator size="large" color="#ffffff" />
@@ -129,7 +131,7 @@ export default function apiKeysScreen() {
129131
{/* Header */}
130132
<View className="mb-6 flex-row justify-between items-center">
131133
<Text className="text-white text-2xl font-bold">API Keys</Text>
132-
<TouchableOpacity onPress={fetchApiKeys}>
134+
<TouchableOpacity onPress={fetchApiKeys} activeOpacity={0.7}>
133135
<MaterialIcons name="refresh" size={24} color="white" />
134136
</TouchableOpacity>
135137
</View>
@@ -170,7 +172,7 @@ export default function apiKeysScreen() {
170172
<TouchableOpacity
171173
onPress={handleCreateKeyWithDisplay}
172174
className="bg-green-600 p-3 rounded-lg flex-row items-center justify-center"
173-
activeOpacity={0.8}
175+
activeOpacity={0.7}
174176
>
175177
<MaterialIcons name="add" size={18} color="white" />
176178
<Text className="text-white text-center font-semibold ml-1">
@@ -265,6 +267,7 @@ export default function apiKeysScreen() {
265267
className={`p-3 rounded-lg flex-row items-center justify-center ${
266268
expired ? "bg-zinc-600" : "bg-red-600"
267269
}`}
270+
activeOpacity={0.7}
268271
>
269272
<MaterialIcons
270273
name={expired ? "block" : "delete"}

app/(tabs)/devices.tsx

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
ActivityIndicator,
99
RefreshControl,
1010
TextInput,
11-
Modal,
1211
} from "react-native";
1312
import { MaterialIcons } from "@expo/vector-icons";
1413
import { useDevices } from "@/app/funcs/devices";
@@ -60,18 +59,6 @@ export default function DevicesScreen() {
6059
fetchDevices();
6160
};
6261

63-
const formatDate = (dateString: string) => {
64-
try {
65-
return new Date(dateString).toLocaleDateString('en-US', {
66-
month: 'short',
67-
day: 'numeric',
68-
hour: '2-digit',
69-
minute: '2-digit'
70-
});
71-
} catch {
72-
return "Unknown";
73-
}
74-
};
7562

7663
return (
7764
<SafeAreaView className="flex-1 bg-zinc-900">

app/(tabs)/preauthkeys.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export default function PreAuthKeysScreen() {
4444
text1: "Copy Failed",
4545
text2: "Could not copy to clipboard",
4646
});
47+
console.error(error)
4748
}
4849
};
4950

app/(tabs)/routes.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
Alert,
1010
RefreshControl,
1111
} from "react-native";
12-
import Toast from "react-native-toast-message";
1312
import { MaterialIcons } from "@expo/vector-icons";
1413
import { useRoutes } from "@/app/funcs/routes";
1514

@@ -22,9 +21,7 @@ export default function RoutesScreen() {
2221
handleDisableRoute,
2322
handleEnableRoute,
2423
routes,
25-
setRoutes,
2624
loading,
27-
setLoading,
2825
fetchRoutes
2926
} = useRoutes();
3027

app/api/acl.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { getServerConfig } from "../utils/getServer";
21
import { getApiEndpoints, makeApiRequest } from "../utils/apiUtils";
32

43
export async function getACLPolicy() {

app/customScreens/[id].tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import React, { useRef } from "react";
22
import {
33
View, Text, TextInput, TouchableOpacity, SafeAreaView,
4-
ScrollView, Animated
4+
Animated
55
} from "react-native";
66
import { MaterialIcons } from "@expo/vector-icons";
77
import { useRouter, useLocalSearchParams } from "expo-router";
8-
import { Device } from "../types";
98
import { useDeviceDetail } from "../funcs/deviceDetail";
109
import { formatDate, getTimeAgo, copyToClipboard } from "../utils/deviceUtils";
1110
import { InfoRow } from "../components/InfoRow";

0 commit comments

Comments
 (0)