Skip to content

Commit

Permalink
Keep trailingComma es5
Browse files Browse the repository at this point in the history
  • Loading branch information
zoontek committed Dec 26, 2023
1 parent 115bef0 commit f2235fe
Show file tree
Hide file tree
Showing 115 changed files with 227 additions and 227 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module.exports = {
"error",
{
quoteProps: "consistent",
trailingComma: "all",
trailingComma: "es5",
},
],
// react
Expand Down
2 changes: 1 addition & 1 deletion FabricExample/__tests__/focused-input-handler.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe("`useFocusedInputHandler` specification", () => {
it("should execute all handlers and change corresponding elements", () => {
let handlers: FocusedInputHandler = {};
(useFocusedInputHandler as jest.Mock).mockImplementation(
(handler) => (handlers = handler),
(handler) => (handlers = handler)
);
const onChangeText = (e: FocusedInputTextChangedEvent) =>
handlers.onChangeText?.(e);
Expand Down
6 changes: 3 additions & 3 deletions FabricExample/__tests__/keyboard-handler.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function TestComponent() {
height.value = e.height;
},
},
[],
[]
);
const style = useAnimatedStyle(
() => ({
Expand All @@ -45,7 +45,7 @@ function TestComponent() {
backgroundColor: "red",
transform: [{ translateY: height.value }],
}),
[],
[]
);

return <Reanimated.View testID="view" style={style} />;
Expand All @@ -55,7 +55,7 @@ describe("keyboard handler specification", () => {
it("should execute all handlers and change corresponding style properties", () => {
let handlers: KeyboardHandler = {};
(useKeyboardHandler as jest.Mock).mockImplementation(
(handler) => (handlers = handler),
(handler) => (handlers = handler)
);
const onStart = (e: NativeEvent) => handlers.onStart?.(e);
const onMove = (e: NativeEvent) => handlers.onMove?.(e);
Expand Down
2 changes: 1 addition & 1 deletion FabricExample/__tests__/reanimated.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function TestComponent() {
backgroundColor: "red",
transform: [{ translateY: height.value }],
}),
[],
[]
);

return <Reanimated.View testID="view" style={style} />;
Expand Down
4 changes: 2 additions & 2 deletions FabricExample/jestSetup.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import "react-native-gesture-handler/jestSetup";
require("react-native-reanimated/lib/module/reanimated2/jestUtils").setUpTests();

jest.mock("react-native-keyboard-controller", () =>
require("react-native-keyboard-controller/jest"),
require("react-native-keyboard-controller/jest")
);

jest.mock("react-native-reanimated", () =>
require("react-native-reanimated/mock"),
require("react-native-reanimated/mock")
);
4 changes: 2 additions & 2 deletions FabricExample/metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ const config = {
blacklistRE: exclusionList(
modules.map(
(m) =>
new RegExp(`^${escape(path.join(root, "node_modules", m))}\\/.*$`),
),
new RegExp(`^${escape(path.join(root, "node_modules", m))}\\/.*$`)
)
),

extraNodeModules: modules.reduce((acc, name) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ export default function AwareScrollViewStickyFooter({ navigation }: Props) {
}, []);
const offset = useMemo(
() => ({ closed: 0, opened: variant === "v1" ? 0 : bottom }),
[bottom, variant],
[bottom, variant]
);
const offsetV3 = useMemo(
() => ({ closed: -50, opened: bottom - 25 }),
[bottom],
[bottom]
);

useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function InteractiveKeyboard({ navigation }: Props) {
() => ({
transform: [{ translateY: -height.value }, ...styles.inverted.transform],
}),
[],
[]
);
const textInputStyle = useAnimatedStyle(
() => ({
Expand All @@ -72,13 +72,13 @@ function InteractiveKeyboard({ navigation }: Props) {
backgroundColor: "#BCBCBC",
transform: [{ translateY: -height.value }],
}),
[],
[]
);
const fakeView = useAnimatedStyle(
() => ({
height: height.value,
}),
[],
[]
);

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function InteractiveKeyboard() {
backgroundColor: "#BCBCBC",
transform: [{ translateY: -height.value }],
}),
[],
[]
);

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default function KeyboardAvoidingViewExample({ navigation }: Props) {
onPress={() => {
const index = behaviors.indexOf(behavior);
setBehavior(
behaviors[index === behaviors.length - 1 ? 0 : index + 1],
behaviors[index === behaviors.length - 1 ? 0 : index + 1]
);
}}
>
Expand Down
4 changes: 2 additions & 2 deletions FabricExample/src/screens/Examples/Lottie/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function LottieAnimation() {
progress.value = e.progress;
},
},
[],
[]
);

const animatedProps = useAnimatedProps(() => {
Expand All @@ -52,7 +52,7 @@ function LottieAnimation() {
// 104 - total frames
// 7 frame - transition begins
// 35 frame - transition ends
[7 / 104, 35 / 104],
[7 / 104, 35 / 104]
),
};
});
Expand Down
2 changes: 1 addition & 1 deletion FabricExample/src/screens/Examples/Main/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const ExampleMain = ({ navigation }: Props) => {
const onExamplePress = useCallback(
(info: ScreenNames) =>
navigation.navigate(ScreenNames.EXAMPLES_STACK, { screen: info }),
[],
[]
);

return (
Expand Down
2 changes: 1 addition & 1 deletion FabricExample/src/screens/Examples/NonUIProps/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function useGradualKeyboardAnimation() {
progress.value = progress.value;
},
},
[],
[]
);

return { height, progress };
Expand Down
4 changes: 2 additions & 2 deletions FabricExample/src/screens/Examples/ReanimatedChat/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const useTelegramTransitions = () => {
0.19919472913616398,
0.010644531250000006,
0.27920937042459737,
0.91025390625,
0.91025390625
),
});
} else {
Expand All @@ -32,7 +32,7 @@ export const useTelegramTransitions = () => {
}
},
},
[],
[]
);

return { height };
Expand Down
8 changes: 4 additions & 4 deletions FabricExample/src/screens/Examples/ReanimatedChat/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ function ReanimatedChat({ navigation }: Props) {
const { height: platform } = useReanimatedKeyboardAnimation();
const height = useDerivedValue(
() => (isTGTransition ? telegram.value : platform.value),
[isTGTransition],
[isTGTransition]
);

const scrollViewStyle = useAnimatedStyle(
() => ({
transform: [{ translateY: height.value }, ...styles.inverted.transform],
}),
[],
[]
);
const textInputStyle = useAnimatedStyle(
() => ({
Expand All @@ -53,13 +53,13 @@ function ReanimatedChat({ navigation }: Props) {
backgroundColor: "#BCBCBC",
transform: [{ translateY: height.value }],
}),
[],
[]
);
const fakeView = useAnimatedStyle(
() => ({
height: Math.abs(height.value),
}),
[],
[]
);

return (
Expand Down
2 changes: 1 addition & 1 deletion FabricExample/src/screens/Examples/StatusBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default function StatusBarManipulation() {
title={`Change ${barStyle}`}
onPress={() =>
setBarStyle(
barStyle === "light-content" ? "dark-content" : "light-content",
barStyle === "light-content" ? "dark-content" : "light-content"
)
}
/>
Expand Down
2 changes: 1 addition & 1 deletion docs/__tests__/screenshot.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function isNotVersionedDocsPathname(pathname: string): boolean {

test.describe("Docusaurus site screenshots", () => {
const pathnames = extractSitemapPathnames(sitemapPath).filter(
isNotVersionedDocsPathname,
isNotVersionedDocsPathname
);
console.log("Pathnames to screenshot:", pathnames);
pathnames.forEach(screenshotPathname);
Expand Down
2 changes: 1 addition & 1 deletion docs/blog/2023-12-26-release-1-10/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ useFocusedInputHandler(
// Your custom logic here
},
},
[],
[]
);
```

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/api/hooks/input/use-focused-input-handler.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ useFocusedInputHandler(
"worklet";
},
},
[],
[]
);
```

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/api/hooks/keyboard/use-keyboard-animation.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class KeyboardAnimation extends React.PureComponent {
// 2. set input mode for android to `adjustResize`
// (can be omitted if you already have `adjustResize` in `AndroidManifest.xml`)
KeyboardController.setInputMode(
AndroidSoftInputModes.SOFT_INPUT_ADJUST_RESIZE,
AndroidSoftInputModes.SOFT_INPUT_ADJUST_RESIZE
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ useKeyboardHandler(
"worklet";
},
},
[],
[]
);
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class KeyboardAnimation extends React.PureComponent {
// 2. set input mode for android to `adjustResize`
// (can be omitted if you already have `adjustResize` in `AndroidManifest.xml`)
KeyboardController.setInputMode(
AndroidSoftInputModes.SOFT_INPUT_ADJUST_RESIZE,
AndroidSoftInputModes.SOFT_INPUT_ADJUST_RESIZE
);
}

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/guides/building-own-hook.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ function useKeyboardAnimation() {
useFocusEffect(
useCallback(() => {
KeyboardController.setInputMode(
AndroidSoftInputModes.SOFT_INPUT_ADJUST_RESIZE,
AndroidSoftInputModes.SOFT_INPUT_ADJUST_RESIZE
);

return () => KeyboardController.setDefaultMode();
}, []),
}, [])
);

const context = useKeyboardContext();
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/guides/interactive-keyboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ useKeyboardHandler(
// your handler for interactive keyboard movement
},
},
[],
[]
);
```

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/recipes/jest-testing-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This library includes a built in mock for Jest. To use it, add the following cod

```js
jest.mock("react-native-keyboard-controller", () =>
require("react-native-keyboard-controller/jest"),
require("react-native-keyboard-controller/jest")
);
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class KeyboardAnimation extends React.PureComponent {
// 2. set input mode for android to `adjustResize`
// (can be omitted if you already have `adjustResize` in `AndroidManifest.xml`)
KeyboardController.setInputMode(
AndroidSoftInputModes.SOFT_INPUT_ADJUST_RESIZE,
AndroidSoftInputModes.SOFT_INPUT_ADJUST_RESIZE
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class KeyboardAnimation extends React.PureComponent {
// 2. set input mode for android to `adjustResize`
// (can be omitted if you already have `adjustResize` in `AndroidManifest.xml`)
KeyboardController.setInputMode(
AndroidSoftInputModes.SOFT_INPUT_ADJUST_RESIZE,
AndroidSoftInputModes.SOFT_INPUT_ADJUST_RESIZE
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
export const useResizeMode = () => {
useEffect(() => {
KeyboardController.setInputMode(
AndroidSoftInputModes.SOFT_INPUT_ADJUST_RESIZE,
AndroidSoftInputModes.SOFT_INPUT_ADJUST_RESIZE
);

return () => KeyboardController.setDefaultMode();
Expand Down
4 changes: 2 additions & 2 deletions docs/versioned_docs/version-1.0.0/guides/building-own-hook.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ function useKeyboardAnimation() {
useFocusEffect(
useCallback(() => {
KeyboardController.setInputMode(
AndroidSoftInputModes.SOFT_INPUT_ADJUST_RESIZE,
AndroidSoftInputModes.SOFT_INPUT_ADJUST_RESIZE
);

return () => KeyboardController.setDefaultMode();
}, []),
}, [])
);

const context = useContext(KeyboardContext);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ useFocusedInputHandler(
"worklet";
},
},
[],
[]
);
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class KeyboardAnimation extends React.PureComponent {
// 2. set input mode for android to `adjustResize`
// (can be omitted if you already have `adjustResize` in `AndroidManifest.xml`)
KeyboardController.setInputMode(
AndroidSoftInputModes.SOFT_INPUT_ADJUST_RESIZE,
AndroidSoftInputModes.SOFT_INPUT_ADJUST_RESIZE
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ useKeyboardHandler(
"worklet";
},
},
[],
[]
);
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class KeyboardAnimation extends React.PureComponent {
// 2. set input mode for android to `adjustResize`
// (can be omitted if you already have `adjustResize` in `AndroidManifest.xml`)
KeyboardController.setInputMode(
AndroidSoftInputModes.SOFT_INPUT_ADJUST_RESIZE,
AndroidSoftInputModes.SOFT_INPUT_ADJUST_RESIZE
);
}

Expand Down
Loading

0 comments on commit f2235fe

Please sign in to comment.