Skip to content

Commit

Permalink
Apply prettier on the whole project files
Browse files Browse the repository at this point in the history
  • Loading branch information
zoontek committed Dec 25, 2023
1 parent a425e7c commit f1d86db
Show file tree
Hide file tree
Showing 175 changed files with 1,704 additions and 1,085 deletions.
19 changes: 10 additions & 9 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ about: Create a report to help us improve
title: ''
labels: bug
assignees: kirillzyusko

---

**Describe the bug**
Expand All @@ -18,6 +17,7 @@ I would be highly appreciate if you can provide repository for reproducing your

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
Expand All @@ -30,13 +30,14 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.

**Smartphone (please complete the following information):**
- Desktop OS: [e.g. Windows 10, MacOS 10.15.5]
- Device: [e.g. iPhone8]
- OS: [e.g. iOS 10.0]
- RN version: [e.g. 0.68.2]
- RN architecture: [e.g. old/new or paper/fabric]
- JS engine: [e.g. JSC, Hermes, v8]
- Library version: [e.g. 1.2.0]

- Desktop OS: [e.g. Windows 10, MacOS 10.15.5]
- Device: [e.g. iPhone8]
- OS: [e.g. iOS 10.0]
- RN version: [e.g. 0.68.2]
- RN architecture: [e.g. old/new or paper/fabric]
- JS engine: [e.g. JSC, Hermes, v8]
- Library version: [e.g. 1.2.0]

**Additional context**
Add any other context about the problem here.
Add any other context about the problem here.
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ about: Suggest an idea for this project
title: ''
labels: Feature
assignees: kirillzyusko

---

**Is your feature request related to a problem? Please describe.**
Expand All @@ -17,4 +16,4 @@ A clear and concise description of what you want to happen.
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
Add any other context or screenshots about the feature request here.
21 changes: 14 additions & 7 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
## 📜 Description

<!-- Describe your changes in detail -->

## 💡 Motivation and Context

<!-- Why is this change required? What problem does it solve? -->
<!-- If it fixes an open issue, please link to the issue here. -->

Expand All @@ -12,26 +14,31 @@
<!-- If your changes don't affect one of platform/language below - then remove this platform/language -->

### JS
-
-

-
-

### iOS
-
-

-
-

### Android
-
-

-
-

## 🤔 How Has This Been Tested?

<!-- Please describe in detail how you tested your changes. -->
<!-- Include details of your testing environment, and the tests you ran to -->
<!-- see how your change affects other areas of the code, etc. -->

## 📸 Screenshots (if appropriate):

<!-- Add screenshots/video if needed -->
<!-- That would be highly appreciated if you can add how it looked before and after your changes -->

## 📝 Checklist

- [ ] CI successfully passed
- [ ] CI successfully passed
2 changes: 1 addition & 1 deletion .github/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
closeComment: true
closeComment: true
6 changes: 3 additions & 3 deletions .github/workflows/android-e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ jobs:
env:
WORKING_DIRECTORY: example
concurrency:
group: android-e2e-${{ github.ref }}
cancel-in-progress: true
group: android-e2e-${{ github.ref }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand Down Expand Up @@ -87,4 +87,4 @@ jobs:
if: ${{ failure() }}
with:
name: android-fail-screen-shoots
path: e2e/artifacts
path: e2e/artifacts
2 changes: 1 addition & 1 deletion .github/workflows/build-android-fabric.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ jobs:
restore-keys: |
${{ runner.os }}-fabric-gradle-
- name: Run Gradle Build for FabricExample/android/
run: cd FabricExample/android && ./gradlew assembleDebug --build-cache -PreactNativeArchitectures=arm64-v8a && cd ../..
run: cd FabricExample/android && ./gradlew assembleDebug --build-cache -PreactNativeArchitectures=arm64-v8a && cd ../..
2 changes: 1 addition & 1 deletion .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-
- name: Run Gradle Build for example/android/
run: cd example/android && ./gradlew assembleDebug --build-cache && cd ../..
run: cd example/android && ./gradlew assembleDebug --build-cache && cd ../..
2 changes: 1 addition & 1 deletion .github/workflows/build-ios-fabric.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,4 @@ jobs:
-configuration Debug \
-destination 'platform=iOS Simulator,name=iPhone 11 Pro' \
build \
CODE_SIGNING_ALLOWED=NO | xcpretty"
CODE_SIGNING_ALLOWED=NO | xcpretty"
2 changes: 1 addition & 1 deletion .github/workflows/build-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ jobs:
-configuration Debug \
-destination 'platform=iOS Simulator,name=iPhone 11 Pro' \
build \
CODE_SIGNING_ALLOWED=NO | xcpretty"
CODE_SIGNING_ALLOWED=NO | xcpretty"
2 changes: 1 addition & 1 deletion .github/workflows/compress-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ jobs:
jpegQuality: '80'
jpegProgressive: false
pngQuality: '80'
webpQuality: '80'
webpQuality: '80'
2 changes: 1 addition & 1 deletion .github/workflows/compress-lottie.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ jobs:
run: find . -name '*.lottie.json' -exec npx lottie-optim -p 1 -o {} {} \;

- name: Verify that the lottie hasn't been changed
run: git diff --exit-code HEAD
run: git diff --exit-code HEAD
2 changes: 1 addition & 1 deletion .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ jobs:
# The GH actions bot is used by default if you didn't specify the two fields.
# You can swap them out with your own user credentials.
user_name: github-actions[bot]
user_email: 41898282+github-actions[bot]@users.noreply.github.com
user_email: 41898282+github-actions[bot]@users.noreply.github.com
2 changes: 1 addition & 1 deletion .github/workflows/docs-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ jobs:
run: yarn playwright test

- name: Upload screenshots to Argos
run: yarn argos upload ./screenshots
run: yarn argos upload ./screenshots
8 changes: 4 additions & 4 deletions .github/workflows/ios-e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ jobs:
env:
WORKING_DIRECTORY: example
concurrency:
group: ios-e2e-${{ github.ref }}
cancel-in-progress: true
group: ios-e2e-${{ github.ref }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand Down Expand Up @@ -81,12 +81,12 @@ jobs:
working-directory: e2e
run: yarn build-example:ios
- name: Use software keyboard
run: defaults write com.apple.iphonesimulator ConnectHardwareKeyboard -bool NO
run: defaults write com.apple.iphonesimulator ConnectHardwareKeyboard -bool NO
- name: Test app
working-directory: e2e
run: yarn test-example:ios
- uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: ios-fail-screen-shoots
path: e2e/artifacts
path: e2e/artifacts
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ jobs:
- run: yarn install --frozen-lockfile
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/size-diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ jobs:
### 📊 Package size report
| Current size | Target Size | Difference |
| ------------- | ------------- | ------------------------ |
| ${{ env.NEW_SIZE }} bytes | ${{ env.OLD_SIZE }} bytes | ${{ env.DIFF }} bytes ${{ env.SIGN }} |
| ${{ env.NEW_SIZE }} bytes | ${{ env.OLD_SIZE }} bytes | ${{ env.DIFF }} bytes ${{ env.SIGN }} |
2 changes: 1 addition & 1 deletion .github/workflows/verify-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ jobs:
python -m pip install --upgrade pip
pip install cpplint
- name: Run cpplint
run: cpplint --linelength=230 --filter=-legal/copyright,-readability/todo,-build/namespaces,-whitespace/comments,-build/c++11,-runtime/int,-runtime/references --quiet --recursive android/src/main/
run: cpplint --linelength=230 --filter=-legal/copyright,-readability/todo,-build/namespaces,-whitespace/comments,-build/c++11,-runtime/int,-runtime/references --quiet --recursive android/src/main/
2 changes: 1 addition & 1 deletion .github/workflows/verify-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ jobs:
- name: Deploy preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: ./docs/build/
source-dir: ./docs/build/
10 changes: 10 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
*.lottie.json

lib/
node_modules/
Pods/

example/android/app/build/
example/ios/build/
FabricExample/android/app/build/
FabricExample/ios/build/
2 changes: 1 addition & 1 deletion FabricExample/.watchmanconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{}
{}
4 changes: 2 additions & 2 deletions FabricExample/__tests__/close-keyboard.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { KeyboardController } from 'react-native-keyboard-controller';
function CloseKeyboard() {
return (
<Button
title='Close keyboard'
testID='close_keyboard'
title="Close keyboard"
testID="close_keyboard"
onPress={() => KeyboardController.dismiss()}
/>
);
Expand Down
20 changes: 13 additions & 7 deletions FabricExample/__tests__/focused-input-handler.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ import React, { useState } from 'react';
import { runOnJS } from 'react-native-reanimated';
import { act, render } from '@testing-library/react-native';

import { FocusedInputHandler, FocusedInputTextChangedEvent, useFocusedInputHandler, useReanimatedFocusedInput } from 'react-native-keyboard-controller';
import {
FocusedInputHandler,
FocusedInputTextChangedEvent,
useFocusedInputHandler,
useReanimatedFocusedInput,
} from 'react-native-keyboard-controller';
import { Text } from 'react-native';

function WhatUserTyped() {
Expand All @@ -17,7 +22,7 @@ function WhatUserTyped() {
},
});

return <Text testID='text'>{text}</Text>;
return <Text testID="text">{text}</Text>;
}

describe('`useFocusedInputHandler` specification', () => {
Expand All @@ -26,24 +31,25 @@ describe('`useFocusedInputHandler` specification', () => {
(useFocusedInputHandler as jest.Mock).mockImplementation(
(handler) => (handlers = handler)
);
const onChangeText = (e: FocusedInputTextChangedEvent) => handlers.onChangeText?.(e);
const onChangeText = (e: FocusedInputTextChangedEvent) =>
handlers.onChangeText?.(e);

const { getByTestId } = render(<WhatUserTyped />);

expect(getByTestId('text')).toHaveTextContent('');
act(() => onChangeText({text: '1'}));
act(() => onChangeText({ text: '1' }));

expect(getByTestId('text')).toHaveTextContent('1');

act(() => onChangeText({text: '12'}));
act(() => onChangeText({ text: '12' }));

expect(getByTestId('text')).toHaveTextContent('12');

act(() => onChangeText({text: '123'}));
act(() => onChangeText({ text: '123' }));

expect(getByTestId('text')).toHaveTextContent('123');

act(() => onChangeText({text: ''}));
act(() => onChangeText({ text: '' }));

expect(getByTestId('text')).toHaveTextContent('');
});
Expand Down
35 changes: 16 additions & 19 deletions FabricExample/__tests__/focused-input.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,16 @@ import { useReanimatedFocusedInput } from 'react-native-keyboard-controller';

function RectangleWithFocusedInputLayout() {
const { input } = useReanimatedFocusedInput();
const style = useAnimatedStyle(
() => {
const layout = input.value?.layout;

return {
top: layout?.y,
left: layout?.x,
height: layout?.height,
width: layout?.width,
};
},
[]
);
const style = useAnimatedStyle(() => {
const layout = input.value?.layout;

return {
top: layout?.y,
left: layout?.x,
height: layout?.height,
width: layout?.width,
};
}, []);

return <Reanimated.View testID="view" style={style} />;
}
Expand All @@ -28,7 +25,7 @@ describe('`useReanimatedFocusedInput` mocking', () => {
it('should have different styles depends on `useReanimatedFocusedInput`', () => {
const { getByTestId, update } = render(<RectangleWithFocusedInputLayout />);

expect(getByTestId('view')).toHaveStyle({
expect(getByTestId('view')).toHaveStyle({
top: 0,
left: 0,
width: 200,
Expand All @@ -48,15 +45,15 @@ describe('`useReanimatedFocusedInput` mocking', () => {
absoluteY: 200,
},
},
}
},
});
update(<RectangleWithFocusedInputLayout />);

expect(getByTestId('view')).toHaveStyle({
top: 100,
left: 10,
width: 190,
height: 80,
top: 100,
left: 10,
width: 190,
height: 80,
});
});
});
2 changes: 1 addition & 1 deletion FabricExample/app.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "KeyboardControllerFabricExample",
"displayName": "KeyboardControllerFabricExample"
}
}
Loading

0 comments on commit f1d86db

Please sign in to comment.