Skip to content

Commit 7d41c0d

Browse files
committed
chore: fix lint
1 parent 2069699 commit 7d41c0d

File tree

4 files changed

+129
-103
lines changed

4 files changed

+129
-103
lines changed

example/src/App.tsx

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default function App() {
1717
{/* Add some components here to test scanning */}
1818
<SimpleComponent text="Hello" />
1919
<SlowComponent />
20-
20+
2121
{/* Render the overlay on top */}
2222
{__DEV__ && <RenderOverlay />}
2323
</View>
@@ -28,15 +28,17 @@ export default function App() {
2828

2929
const SimpleComponent = React.memo(({ text }: { text: string }) => {
3030
console.log('Rendering SimpleComponent');
31-
return <Text style={{ margin: 5 }}>Simple: {text}</Text>;
31+
return <Text style={styles.simpleText}>Simple: {text}</Text>;
3232
});
3333

3434
const SlowComponent = () => {
3535
console.log('Rendering SlowComponent');
3636
// Simulate some work
3737
const end = Date.now() + 50; // Simulate 50ms render time
38-
while (Date.now() < end) { /* busy wait */ }
39-
return <Text style={{ margin: 5, color: 'red' }}>I am slowww</Text>;
38+
while (Date.now() < end) {
39+
/* busy wait */
40+
}
41+
return <Text style={styles.slowText}>I am slowww</Text>;
4042
};
4143

4244
// -------------------------------------
@@ -47,4 +49,11 @@ const styles = StyleSheet.create({
4749
alignItems: 'center',
4850
justifyContent: 'center',
4951
},
52+
simpleText: {
53+
margin: 5,
54+
},
55+
slowText: {
56+
margin: 5,
57+
color: 'red',
58+
},
5059
});

src/RenderOverlay.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const updateHighlights = (newHighlights: Highlight[]) => {
2626
listeners.forEach((listener) => listener(newHighlights));
2727
};
2828

29-
// --- Public API ---
29+
// --- Public API ---
3030

3131
/**
3232
* Adds a highlight box to be rendered by the overlay.
@@ -39,7 +39,7 @@ export const addHighlight = (
3939
) => {
4040
// Create opacity animation value for fade effect
4141
const opacity = new Animated.Value(1);
42-
42+
4343
const newHighlight: Highlight = {
4444
id,
4545
...layout,
@@ -61,7 +61,7 @@ export const addHighlight = (
6161
// Remove highlights older than HIGHLIGHT_DURATION
6262
const now = Date.now();
6363
const updatedHighlights = [
64-
...highlightsState.filter(h => (now - h.timestamp) < HIGHLIGHT_DURATION),
64+
...highlightsState.filter((h) => now - h.timestamp < HIGHLIGHT_DURATION),
6565
newHighlight,
6666
];
6767

@@ -72,7 +72,7 @@ export const addHighlight = (
7272
* Removes a specific highlight by ID
7373
*/
7474
const removeHighlight = (id: string) => {
75-
const updatedHighlights = highlightsState.filter(h => h.id !== id);
75+
const updatedHighlights = highlightsState.filter((h) => h.id !== id);
7676
if (updatedHighlights.length !== highlightsState.length) {
7777
updateHighlights(updatedHighlights);
7878
}
@@ -85,7 +85,7 @@ export const clearHighlights = () => {
8585
updateHighlights([]);
8686
};
8787

88-
// --- Component ---
88+
// --- Component ---
8989

9090
export const RenderOverlay: React.FC = () => {
9191
const [highlights, setHighlights] = useState<Highlight[]>(highlightsState);
@@ -96,7 +96,7 @@ export const RenderOverlay: React.FC = () => {
9696
listeners.push(setHighlights);
9797
// Set initial state in case highlights were added before mount
9898
setHighlights(highlightsState);
99-
99+
100100
return () => {
101101
mounted.current = false;
102102
// Unsubscribe on unmount
@@ -105,7 +105,7 @@ export const RenderOverlay: React.FC = () => {
105105
}, []);
106106

107107
// On Android, measure() might give coordinates relative to the root view,
108-
// on iOS, it might be relative to the window.
108+
// on iOS, it might be relative to the window.
109109
// `position: 'absolute'` without top/left defaults to 0,0 relative to parent,
110110
// which should work if the Overlay is rendered at the root.
111111
// Adjustments might be needed based on testing.
@@ -143,4 +143,4 @@ const styles = StyleSheet.create({
143143
borderWidth: 2, // Make highlights visible
144144
backgroundColor: 'rgba(0, 0, 255, 0.05)', // Optional: slight background tint
145145
},
146-
});
146+
});

src/globals.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ declare global {
44
}
55

66
// Export {} to make this file a module (avoids isolatedModules error if empty)
7-
export {};
7+
export {};

0 commit comments

Comments
 (0)