Skip to content

Commit c045da2

Browse files
committed
chore: ran lint --fix
1 parent 47952f8 commit c045da2

16 files changed

+211
-214
lines changed

babel.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
2-
presets: ['module:metro-react-native-babel-preset'],
2+
presets: ["module:metro-react-native-babel-preset"],
33
};

example/Tests/TestWrapper.tsx

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
import React from 'react';
1+
import React from "react";
22
import {
33
ActivityIndicator,
44
StyleSheet,
55
Text,
66
TouchableOpacity,
77
View,
8-
} from 'react-native';
8+
} from "react-native";
99

10-
export type TestState = 'notrun' | 'running' | 'success' | 'failure';
10+
export type TestState = "notrun" | "running" | "success" | "failure";
1111

1212
type Props = {
1313
state: TestState;
1414
name: string;
1515
onRun: () => void;
1616
};
1717

18-
export const TestWrapper: React.FC<Props> = ({state, name, onRun}) => {
18+
export const TestWrapper: React.FC<Props> = ({ state, name, onRun }) => {
1919
return (
2020
<View style={styles.container}>
2121
<View style={styles.symbolContainer}>
22-
{state === 'running' ? (
22+
{state === "running" ? (
2323
<ActivityIndicator />
24-
) : state === 'notrun' ? (
24+
) : state === "notrun" ? (
2525
<Text style={styles.checkmark}></Text>
26-
) : state === 'failure' ? (
26+
) : state === "failure" ? (
2727
<Text style={styles.fail}>𐄂</Text>
2828
) : (
2929
<Text style={styles.success}></Text>
@@ -32,7 +32,7 @@ export const TestWrapper: React.FC<Props> = ({state, name, onRun}) => {
3232
<Text style={styles.name}>{name}</Text>
3333
<TouchableOpacity style={styles.button} onPress={onRun}>
3434
<Text style={styles.buttonText}>
35-
{state === 'failure' ? 'rerun' : 'run'}
35+
{state === "failure" ? "rerun" : "run"}
3636
</Text>
3737
</TouchableOpacity>
3838
</View>
@@ -41,24 +41,24 @@ export const TestWrapper: React.FC<Props> = ({state, name, onRun}) => {
4141

4242
const styles = StyleSheet.create({
4343
container: {
44-
flexDirection: 'row',
45-
alignItems: 'center',
44+
flexDirection: "row",
45+
alignItems: "center",
4646
height: 24,
4747
},
4848
symbolContainer: {
4949
width: 38,
50-
alignItems: 'center',
50+
alignItems: "center",
5151
},
5252
checkmark: {
5353
fontSize: 22,
5454
},
5555
success: {
5656
fontSize: 22,
57-
color: 'green',
57+
color: "green",
5858
},
5959
fail: {
6060
fontSize: 22,
61-
color: 'red',
61+
color: "red",
6262
},
6363
name: {
6464
flex: 1,
@@ -67,6 +67,6 @@ const styles = StyleSheet.create({
6767
paddingHorizontal: 8,
6868
},
6969
buttonText: {
70-
color: '#0000BB',
70+
color: "#0000BB",
7171
},
7272
});

example/Tests/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export * from './useTestRunner';
2-
export * from './tests';
1+
export * from "./useTestRunner";
2+
export * from "./tests";

example/Tests/sharedvalue-tests.ts

+35-35
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import {Worklets} from 'react-native-worklets';
2-
import {Expect, ExpectException, ExpectValue} from './utils';
1+
import { Worklets } from "react-native-worklets";
2+
import { Expect, ExpectException, ExpectValue } from "./utils";
33

44
export const sharedvalue_tests = {
55
get_set_numeric_value: () => {
@@ -20,62 +20,62 @@ export const sharedvalue_tests = {
2020
},
2121

2222
get_set_string_value: () => {
23-
const sharedValue = Worklets.createSharedValue('hello world');
24-
sharedValue.value = 'hello worklet';
25-
return ExpectValue(sharedValue.value, 'hello worklet');
23+
const sharedValue = Worklets.createSharedValue("hello world");
24+
sharedValue.value = "hello worklet";
25+
return ExpectValue(sharedValue.value, "hello worklet");
2626
},
2727

2828
get_set_object_value: () => {
29-
const sharedValue = Worklets.createSharedValue({a: 100, b: 200});
29+
const sharedValue = Worklets.createSharedValue({ a: 100, b: 200 });
3030
sharedValue.value.a = 50;
3131
sharedValue.value.b = 100;
32-
return ExpectValue(sharedValue.value, {a: 50, b: 100});
32+
return ExpectValue(sharedValue.value, { a: 50, b: 100 });
3333
},
3434

3535
get_set_array_value: () => {
3636
const sharedValue = Worklets.createSharedValue([100, 50]);
3737
return ExpectValue(sharedValue.value[0], 100).then(() =>
38-
ExpectValue(sharedValue.value[1], 50),
38+
ExpectValue(sharedValue.value[1], 50)
3939
);
4040
},
4141

4242
box_number_to_string: () => {
4343
const sharedValue = Worklets.createSharedValue(100);
4444
// @ts-ignore
45-
sharedValue.value = '100';
46-
return ExpectValue(sharedValue.value, '100');
45+
sharedValue.value = "100";
46+
return ExpectValue(sharedValue.value, "100");
4747
},
4848

4949
box_string_to_number: () => {
50-
const sharedValue = Worklets.createSharedValue('100');
50+
const sharedValue = Worklets.createSharedValue("100");
5151
// @ts-ignore
5252
sharedValue.value = 100;
5353
return ExpectValue(sharedValue.value, 100);
5454
},
5555

5656
box_string_to_array: () => {
57-
const sharedValue = Worklets.createSharedValue('100');
57+
const sharedValue = Worklets.createSharedValue("100");
5858
// @ts-ignore
5959
sharedValue.value = [100, 200];
6060
return ExpectValue(sharedValue.value, [100, 200]);
6161
},
6262

6363
box_string_to_object: () => {
64-
const sharedValue = Worklets.createSharedValue('100');
64+
const sharedValue = Worklets.createSharedValue("100");
6565
// @ts-ignore
66-
sharedValue.value = {a: 100, b: 200};
67-
return ExpectValue(sharedValue.value, {a: 100, b: 200});
66+
sharedValue.value = { a: 100, b: 200 };
67+
return ExpectValue(sharedValue.value, { a: 100, b: 200 });
6868
},
6969

7070
box_array_to_object: () => {
7171
const sharedValue = Worklets.createSharedValue([100, 200]);
7272
// @ts-ignore
73-
sharedValue.value = {a: 100, b: 200};
74-
return ExpectValue(sharedValue.value, {a: 100, b: 200});
73+
sharedValue.value = { a: 100, b: 200 };
74+
return ExpectValue(sharedValue.value, { a: 100, b: 200 });
7575
},
7676

7777
box_object_to_array: () => {
78-
const sharedValue = Worklets.createSharedValue({a: 100, b: 200});
78+
const sharedValue = Worklets.createSharedValue({ a: 100, b: 200 });
7979
// @ts-ignore
8080
sharedValue.value = [100.34, 200];
8181
return ExpectValue(sharedValue.value, [100.34, 200]);
@@ -95,8 +95,8 @@ export const sharedvalue_tests = {
9595

9696
array_destructure_to_object: () => {
9797
const sharedValue = Worklets.createSharedValue([100, 200]);
98-
const p = {...sharedValue.value};
99-
return ExpectValue(p, {0: 100, 1: 200});
98+
const p = { ...sharedValue.value };
99+
return ExpectValue(p, { 0: 100, 1: 200 });
100100
},
101101

102102
array_length: () => {
@@ -105,35 +105,35 @@ export const sharedvalue_tests = {
105105
},
106106

107107
object_value_destructure: () => {
108-
const sharedValue = Worklets.createSharedValue({a: 100, b: 200});
109-
const {a, b} = {...sharedValue.value};
110-
return ExpectValue({a, b}, {a: 100, b: 100});
108+
const sharedValue = Worklets.createSharedValue({ a: 100, b: 200 });
109+
const { a, b } = { ...sharedValue.value };
110+
return ExpectValue({ a, b }, { a: 100, b: 100 });
111111
},
112112

113113
object_value_spread: () => {
114-
const sharedValue = Worklets.createSharedValue({a: 100, b: 200});
115-
const p = {...sharedValue.value};
116-
return ExpectValue(p, {a: 100, b: 200});
114+
const sharedValue = Worklets.createSharedValue({ a: 100, b: 200 });
115+
const p = { ...sharedValue.value };
116+
return ExpectValue(p, { a: 100, b: 200 });
117117
},
118118

119119
set_value_from_worklet: () => {
120-
const sharedValue = Worklets.createSharedValue('hello world');
120+
const sharedValue = Worklets.createSharedValue("hello world");
121121
const worklet = Worklets.createRunInContextFn(function () {
122-
'worklet';
123-
sharedValue.value = 'hello worklet';
122+
"worklet";
123+
sharedValue.value = "hello worklet";
124124
});
125-
sharedValue.value = 'hello worklet';
125+
sharedValue.value = "hello worklet";
126126
return Expect(worklet(), () =>
127-
sharedValue.value === 'hello worklet'
127+
sharedValue.value === "hello worklet"
128128
? undefined
129-
: `Expected ${"'hello worklet'"} but got ${sharedValue.value}`,
129+
: `Expected ${"'hello worklet'"} but got ${sharedValue.value}`
130130
);
131131
},
132132

133133
set_function_with_error: () => {
134134
return ExpectException(() => {
135135
Worklets.createSharedValue(() => {});
136-
}, 'Regular javascript functions cannot be shared.');
136+
}, "Regular javascript functions cannot be shared.");
137137
},
138138

139139
add_listener: () => {
@@ -149,12 +149,12 @@ export const sharedvalue_tests = {
149149
add_listener_from_worklet_should_fail: () => {
150150
const sharedValue = Worklets.createSharedValue(100);
151151
const worklet = Worklets.createRunInContextFn(function () {
152-
'worklet';
152+
"worklet";
153153
sharedValue.addListener(() => {});
154154
});
155155
return ExpectException(
156156
worklet,
157-
'addListener can only be called from the main Javascript context and not from a worklet.',
157+
"addListener can only be called from the main Javascript context and not from a worklet."
158158
);
159159
},
160160
};

example/Tests/tests.ts

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import {worklet_tests} from './worklet-tests';
2-
import {sharedvalue_tests} from './sharedvalue-tests';
3-
import {wrapper_tests} from './wrapper-tests';
4-
import {worklet_context_tests} from './worklet-context-tests';
1+
import { worklet_tests } from "./worklet-tests";
2+
import { sharedvalue_tests } from "./sharedvalue-tests";
3+
import { wrapper_tests } from "./wrapper-tests";
4+
import { worklet_context_tests } from "./worklet-context-tests";
55

6-
export const Tests: {[key: string]: {[key: string]: () => Promise<void>}} = {
7-
Worklets: {...worklet_tests},
8-
Contexts: {...worklet_context_tests},
9-
SharedValues: {...sharedvalue_tests},
10-
WrapperTests: {...wrapper_tests},
11-
};
6+
export const Tests: { [key: string]: { [key: string]: () => Promise<void> } } =
7+
{
8+
Worklets: { ...worklet_tests },
9+
Contexts: { ...worklet_context_tests },
10+
SharedValues: { ...sharedvalue_tests },
11+
WrapperTests: { ...wrapper_tests },
12+
};

example/Tests/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export type TestState = 'notrun' | 'running' | 'success' | 'failure';
1+
export type TestState = "notrun" | "running" | "success" | "failure";
22

33
export type TestInfo = {
44
run: () => Promise<void>;

0 commit comments

Comments
 (0)