Skip to content

Commit 6182583

Browse files
chore: upgrade eslint to 9
1 parent 0a5f588 commit 6182583

27 files changed

+1695
-529
lines changed

.eslintrc.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

.prettierrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ module.exports = {
44
bracketSpacing: false,
55
singleQuote: true,
66
trailingComma: 'all',
7-
};
7+
}

apps/fs-experiment/App.tsx

Lines changed: 95 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,26 @@
1-
import React, { useState } from 'react';
1+
import React, {useState} from 'react'
22
import {
3+
Platform,
34
SafeAreaView,
45
ScrollView,
56
StatusBar,
67
StyleSheet,
78
Text,
89
TextInput,
910
TouchableOpacity,
10-
View,
1111
useColorScheme,
12-
Platform,
13-
} from 'react-native';
14-
15-
import SandboxReactNativeView from 'react-native-multinstance';
16-
12+
View,
13+
} from 'react-native'
1714
// File system imports
18-
import RNFS from 'react-native-fs';
15+
import RNFS from 'react-native-fs'
16+
import SandboxReactNativeView from 'react-native-multinstance'
1917

20-
const SHARED_FILE_PATH = `${RNFS.DocumentDirectoryPath}/shared_test_file.txt`;
18+
const SHARED_FILE_PATH = `${RNFS.DocumentDirectoryPath}/shared_test_file.txt`
2119

2220
function App(): React.JSX.Element {
23-
const isDarkMode = useColorScheme() === 'dark';
24-
const [textContent, setTextContent] = useState<string>('');
25-
const [status, setStatus] = useState<string>('Ready');
21+
const isDarkMode = useColorScheme() === 'dark'
22+
const [textContent, setTextContent] = useState<string>('')
23+
const [status, setStatus] = useState<string>('Ready')
2624

2725
const theme = {
2826
background: isDarkMode ? '#000000' : '#ffffff',
@@ -34,78 +32,85 @@ function App(): React.JSX.Element {
3432
border: isDarkMode ? '#38383a' : '#c6c6c8',
3533
success: '#34c759',
3634
error: '#ff3b30',
37-
};
35+
}
3836

3937
const writeFile = async () => {
4038
try {
41-
setStatus('Writing file...');
42-
await RNFS.writeFile(SHARED_FILE_PATH, textContent, 'utf8');
43-
setStatus(`Successfully wrote: "${textContent}"`);
39+
setStatus('Writing file...')
40+
await RNFS.writeFile(SHARED_FILE_PATH, textContent, 'utf8')
41+
setStatus(`Successfully wrote: "${textContent}"`)
4442
} catch (error) {
45-
setStatus(`Write error: ${(error as Error).message}`);
43+
setStatus(`Write error: ${(error as Error).message}`)
4644
}
47-
};
45+
}
4846

4947
const readFile = async () => {
5048
try {
51-
setStatus('Reading file...');
52-
const content = await RNFS.readFile(SHARED_FILE_PATH, 'utf8');
53-
setTextContent(content);
54-
setStatus(`Successfully read: "${content}"`);
49+
setStatus('Reading file...')
50+
const content = await RNFS.readFile(SHARED_FILE_PATH, 'utf8')
51+
setTextContent(content)
52+
setStatus(`Successfully read: "${content}"`)
5553
} catch (error) {
56-
setStatus(`Read error: ${(error as Error).message}`);
54+
setStatus(`Read error: ${(error as Error).message}`)
5755
}
58-
};
56+
}
5957

6058
const getStatusStyle = () => {
6159
if (status.includes('error')) {
62-
return { color: theme.error };
60+
return {color: theme.error}
6361
}
6462
if (status.includes('Successfully')) {
65-
return { color: theme.success };
63+
return {color: theme.success}
6664
}
67-
return { color: theme.textSecondary };
68-
};
65+
return {color: theme.textSecondary}
66+
}
6967

7068
return (
71-
<SafeAreaView style={[styles.container, { backgroundColor: theme.background }]}>
69+
<SafeAreaView
70+
style={[styles.container, {backgroundColor: theme.background}]}>
7271
<StatusBar
7372
barStyle={isDarkMode ? 'light-content' : 'dark-content'}
7473
backgroundColor={theme.background}
7574
/>
7675
<ScrollView
7776
contentInsetAdjustmentBehavior="automatic"
78-
style={{ backgroundColor: theme.background }}
77+
style={{backgroundColor: theme.background}}
7978
showsVerticalScrollIndicator={false}>
80-
8179
{/* Header */}
82-
<View style={[styles.header, { backgroundColor: theme.surface }]}>
83-
<Text style={[styles.headerTitle, { color: theme.text }]}>
80+
<View style={[styles.header, {backgroundColor: theme.surface}]}>
81+
<Text style={[styles.headerTitle, {color: theme.text}]}>
8482
File System Sandbox Demo
8583
</Text>
86-
<Text style={[styles.headerSubtitle, { color: theme.textSecondary }]}>
84+
<Text style={[styles.headerSubtitle, {color: theme.textSecondary}]}>
8785
Multi-instance file system access testing
8886
</Text>
8987
</View>
9088

9189
<View style={styles.content}>
9290
{/* Host Application Section */}
93-
<View style={[styles.card, { backgroundColor: theme.surface, borderColor: theme.border }]}>
91+
<View
92+
style={[
93+
styles.card,
94+
{backgroundColor: theme.surface, borderColor: theme.border},
95+
]}>
9496
<View style={styles.cardHeader}>
95-
<Text style={[styles.cardTitle, { color: theme.text }]}>
97+
<Text style={[styles.cardTitle, {color: theme.text}]}>
9698
Host Application
9799
</Text>
98-
<View style={[styles.badge, { backgroundColor: theme.primary }]}>
100+
<View style={[styles.badge, {backgroundColor: theme.primary}]}>
99101
<Text style={styles.badgeText}>Primary</Text>
100102
</View>
101103
</View>
102104

103105
<TextInput
104-
style={[styles.textInput, {
105-
color: theme.text,
106-
backgroundColor: theme.background,
107-
borderColor: theme.border,
108-
}]}
106+
style={[
107+
styles.textInput,
108+
{
109+
color: theme.text,
110+
backgroundColor: theme.background,
111+
borderColor: theme.border,
112+
},
113+
]}
109114
value={textContent}
110115
onChangeText={setTextContent}
111116
placeholder="Enter text to write to file..."
@@ -115,80 +120,108 @@ function App(): React.JSX.Element {
115120

116121
<View style={styles.buttonGroup}>
117122
<TouchableOpacity
118-
style={[styles.button, styles.primaryButton, { backgroundColor: theme.primary }]}
123+
style={[
124+
styles.button,
125+
styles.primaryButton,
126+
{backgroundColor: theme.primary},
127+
]}
119128
onPress={writeFile}>
120129
<Text style={styles.buttonText}>Write File</Text>
121130
</TouchableOpacity>
122131

123132
<TouchableOpacity
124-
style={[styles.button, styles.secondaryButton, { backgroundColor: theme.secondary }]}
133+
style={[
134+
styles.button,
135+
styles.secondaryButton,
136+
{backgroundColor: theme.secondary},
137+
]}
125138
onPress={readFile}>
126139
<Text style={styles.buttonText}>Read File</Text>
127140
</TouchableOpacity>
128141
</View>
129142

130-
<View style={[styles.statusContainer, { backgroundColor: theme.background }]}>
131-
<Text style={[styles.statusLabel, { color: theme.textSecondary }]}>Status:</Text>
143+
<View
144+
style={[
145+
styles.statusContainer,
146+
{backgroundColor: theme.background},
147+
]}>
148+
<Text style={[styles.statusLabel, {color: theme.textSecondary}]}>
149+
Status:
150+
</Text>
132151
<Text style={[styles.statusText, getStatusStyle()]}>
133152
{status}
134153
</Text>
135154
</View>
136155

137-
<Text style={[styles.pathText, { color: theme.textSecondary }]}>
156+
<Text style={[styles.pathText, {color: theme.textSecondary}]}>
138157
{SHARED_FILE_PATH}
139158
</Text>
140159
</View>
141160

142161
{/* Sandbox Sections */}
143-
<View style={[styles.card, { backgroundColor: theme.surface, borderColor: theme.border }]}>
162+
<View
163+
style={[
164+
styles.card,
165+
{backgroundColor: theme.surface, borderColor: theme.border},
166+
]}>
144167
<View style={styles.cardHeader}>
145-
<Text style={[styles.cardTitle, { color: theme.text }]}>
168+
<Text style={[styles.cardTitle, {color: theme.text}]}>
146169
Sandbox: react-native-fs
147170
</Text>
148171
<View style={[styles.badge, styles.sandboxBadge]}>
149172
<Text style={styles.badgeText}>Sandbox</Text>
150173
</View>
151174
</View>
152175
<SandboxReactNativeView
153-
style={[styles.sandbox, { backgroundColor: theme.background, borderColor: theme.border }]}
176+
style={[
177+
styles.sandbox,
178+
{backgroundColor: theme.background, borderColor: theme.border},
179+
]}
154180
moduleName={'AppFS'}
155181
jsBundleSource="sandbox-fs"
156182
allowedTurboModules={['RNFSManager', 'FileReaderModule']}
157183
onMessage={message => {
158-
console.log('Host received message from sandbox:', message);
184+
console.log('Host received message from sandbox:', message)
159185
}}
160186
onError={error => {
161-
console.log('Host received error from sandbox:', error);
187+
console.log('Host received error from sandbox:', error)
162188
}}
163189
/>
164190
</View>
165191

166-
<View style={[styles.card, { backgroundColor: theme.surface, borderColor: theme.border }]}>
192+
<View
193+
style={[
194+
styles.card,
195+
{backgroundColor: theme.surface, borderColor: theme.border},
196+
]}>
167197
<View style={styles.cardHeader}>
168-
<Text style={[styles.cardTitle, { color: theme.text }]}>
198+
<Text style={[styles.cardTitle, {color: theme.text}]}>
169199
Sandbox: react-native-file-access
170200
</Text>
171201
<View style={[styles.badge, styles.sandboxBadge]}>
172202
<Text style={styles.badgeText}>Sandbox</Text>
173203
</View>
174204
</View>
175205
<SandboxReactNativeView
176-
style={[styles.sandbox, { backgroundColor: theme.background, borderColor: theme.border }]}
206+
style={[
207+
styles.sandbox,
208+
{backgroundColor: theme.background, borderColor: theme.border},
209+
]}
177210
moduleName={'AppFileAccess'}
178211
allowedTurboModules={['FileAccess']}
179212
jsBundleSource="sandbox-file-access"
180213
onMessage={message => {
181-
console.log('Host received message from sandbox:', message);
214+
console.log('Host received message from sandbox:', message)
182215
}}
183216
onError={error => {
184-
console.log('Host received error from sandbox:', error);
217+
console.log('Host received error from sandbox:', error)
185218
}}
186219
/>
187220
</View>
188221
</View>
189222
</ScrollView>
190223
</SafeAreaView>
191-
);
224+
)
192225
}
193226

194227
const styles = StyleSheet.create({
@@ -201,7 +234,7 @@ const styles = StyleSheet.create({
201234
...Platform.select({
202235
ios: {
203236
shadowColor: '#000',
204-
shadowOffset: { width: 0, height: 1 },
237+
shadowOffset: {width: 0, height: 1},
205238
shadowOpacity: 0.1,
206239
shadowRadius: 4,
207240
},
@@ -231,7 +264,7 @@ const styles = StyleSheet.create({
231264
...Platform.select({
232265
ios: {
233266
shadowColor: '#000',
234-
shadowOffset: { width: 0, height: 2 },
267+
shadowOffset: {width: 0, height: 2},
235268
shadowOpacity: 0.1,
236269
shadowRadius: 8,
237270
},
@@ -325,6 +358,6 @@ const styles = StyleSheet.create({
325358
borderWidth: 1,
326359
borderRadius: 8,
327360
},
328-
});
361+
})
329362

330-
export default App;
363+
export default App

0 commit comments

Comments
 (0)