diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 7927cb4fe..78b8f4648 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -1,86 +1,83 @@ module.exports = { root: true, - plugins: ['@typescript-eslint', 'react', 'react-native', 'jest', 'import'], + plugins: ["@typescript-eslint", "react", "react-native", "jest", "import"], extends: [ - '@react-native', - 'prettier', - 'eslint:recommended', - 'plugin:@typescript-eslint/recommended', - 'plugin:jest/recommended', - 'plugin:import/typescript', + "@react-native", + "prettier", + "eslint:recommended", + "plugin:@typescript-eslint/recommended", + "plugin:jest/recommended", + "plugin:import/typescript", ], settings: { - 'import/parsers': { - '@typescript-eslint/parser': ['.ts', '.tsx'], + "import/parsers": { + "@typescript-eslint/parser": [".ts", ".tsx"], }, - 'import/resolver': { + "import/resolver": { typescript: { alwaysTryTypes: true, - project: '/tsconfig.json', + project: "/tsconfig.json", }, }, }, rules: { - 'prettier/prettier': [ - 'error', + "prettier/prettier": [ + "error", { - quoteProps: 'consistent', - singleQuote: true, - tabWidth: 2, - trailingComma: 'es5', - useTabs: false, + quoteProps: "consistent", + trailingComma: "all", }, ], // react - 'react-hooks/exhaustive-deps': 'warn', + "react-hooks/exhaustive-deps": "warn", // typescript - '@typescript-eslint/consistent-type-imports': [ - 'error', - { prefer: 'type-imports' }, + "@typescript-eslint/consistent-type-imports": [ + "error", + { prefer: "type-imports" }, ], - '@typescript-eslint/no-var-requires': 'warn', + "@typescript-eslint/no-var-requires": "warn", // import - 'sort-imports': [ - 'error', + "sort-imports": [ + "error", { // sort destructure imports ignoreCase: false, ignoreDeclarationSort: true, ignoreMemberSort: false, - memberSyntaxSortOrder: ['none', 'all', 'single', 'multiple'], + memberSyntaxSortOrder: ["none", "all", "single", "multiple"], allowSeparatedGroups: true, }, ], - 'import/order': [ - 'error', + "import/order": [ + "error", { - 'groups': [ - 'builtin', - 'external', - 'internal', - 'parent', - 'sibling', - 'index', - 'type', + "groups": [ + "builtin", + "external", + "internal", + "parent", + "sibling", + "index", + "type", ], - 'alphabetize': { - order: 'asc', + "alphabetize": { + order: "asc", caseInsensitive: true, }, - 'newlines-between': 'always', + "newlines-between": "always", }, ], }, overrides: [ { - files: ['src/specs/**'], + files: ["src/specs/**"], rules: { - '@typescript-eslint/ban-types': [ - 'error', + "@typescript-eslint/ban-types": [ + "error", { extendDefaults: true, types: { - '{}': false, + "{}": false, }, }, ], @@ -88,15 +85,8 @@ module.exports = { }, ], env: { - 'react-native/react-native': true, - 'jest/globals': true, + "react-native/react-native": true, + "jest/globals": true, }, - ignorePatterns: [ - 'node_modules/**', - 'lib/**', - 'example/**', - 'FabricExample/**', - 'docs/**', - 'scripts/**', - ], + ignorePatterns: ["node_modules/**", "lib/**", "scripts/**"], }; diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index d862287a6..923f67ceb 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,10 +1,9 @@ --- name: Bug report about: Create a report to help us improve -title: '' +title: "" labels: bug assignees: kirillzyusko - --- **Describe the bug** @@ -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 '....' @@ -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. \ No newline at end of file +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index fcb7292e1..aa9210140 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -1,10 +1,9 @@ --- name: Feature request about: Suggest an idea for this project -title: '' +title: "" labels: Feature assignees: kirillzyusko - --- **Is your feature request related to a problem? Please describe.** @@ -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. \ No newline at end of file +Add any other context or screenshots about the feature request here. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 741246d0d..69dcffd3b 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,7 +1,9 @@ ## πŸ“œ Description + ## πŸ’‘ Motivation and Context + @@ -12,26 +14,31 @@ ### JS -- -- + +- +- ### iOS -- -- + +- +- ### Android -- -- + +- +- ## πŸ€” How Has This Been Tested? + ## πŸ“Έ Screenshots (if appropriate): + ## πŸ“ Checklist -- [ ] CI successfully passed \ No newline at end of file +- [ ] CI successfully passed diff --git a/.github/stale.yml b/.github/stale.yml index 29c8b6ea7..dd4566889 100644 --- a/.github/stale.yml +++ b/.github/stale.yml @@ -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 \ No newline at end of file +closeComment: true diff --git a/.github/workflows/android-e2e-test.yml b/.github/workflows/android-e2e-test.yml index d14bfb64c..d92b20b20 100644 --- a/.github/workflows/android-e2e-test.yml +++ b/.github/workflows/android-e2e-test.yml @@ -2,22 +2,22 @@ name: πŸ›  Android e2e tests on: pull_request: paths: - - '.github/workflows/android-e2e-test.yml' - - 'package.json' - - 'android/**' - - 'example/**' - - 'e2e/**' - - 'src/**' + - ".github/workflows/android-e2e-test.yml" + - "package.json" + - "android/**" + - "example/**" + - "e2e/**" + - "src/**" push: branches: - main paths: - - '.github/workflows/android-e2e-test.yml' - - 'package.json' - - 'android/**' - - 'example/**' - - 'e2e/**' - - 'src/**' + - ".github/workflows/android-e2e-test.yml" + - "package.json" + - "android/**" + - "example/**" + - "e2e/**" + - "src/**" jobs: test: @@ -27,19 +27,19 @@ 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 with: - node-version: 16.x - cache: 'yarn' + node-version: 18.x + cache: "yarn" - name: Setup JDK 11 uses: actions/setup-java@v3 with: - distribution: 'microsoft' - java-version: '11' + distribution: "microsoft" + java-version: "11" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT @@ -77,8 +77,8 @@ jobs: api-level: 28 target: default profile: pixel_2 - ram-size: '4096M' - disk-size: '10G' + ram-size: "4096M" + disk-size: "10G" disable-animations: false avd-name: e2e_emulator arch: x86_64 @@ -87,4 +87,4 @@ jobs: if: ${{ failure() }} with: name: android-fail-screen-shoots - path: e2e/artifacts \ No newline at end of file + path: e2e/artifacts diff --git a/.github/workflows/build-android-fabric.yml b/.github/workflows/build-android-fabric.yml index 45bf740fc..b4e8836ec 100644 --- a/.github/workflows/build-android-fabric.yml +++ b/.github/workflows/build-android-fabric.yml @@ -5,20 +5,20 @@ on: branches: - main paths: - - '.github/workflows/build-android-fabric.yml' - - 'android/**' - - 'FabricExample/android/**' - - 'yarn.lock' - - 'FabricExample/yarn.lock' - - 'src/specs/**' + - ".github/workflows/build-android-fabric.yml" + - "android/**" + - "FabricExample/android/**" + - "yarn.lock" + - "FabricExample/yarn.lock" + - "src/specs/**" pull_request: paths: - - '.github/workflows/build-android-fabric.yml' - - 'android/**' - - 'FabricExample/android/**' - - 'yarn.lock' - - 'FabricExample/yarn.lock' - - 'src/specs/**' + - ".github/workflows/build-android-fabric.yml" + - "android/**" + - "FabricExample/android/**" + - "yarn.lock" + - "FabricExample/yarn.lock" + - "src/specs/**" jobs: build: @@ -30,8 +30,8 @@ jobs: - name: Setup JDK 11 uses: actions/setup-java@v3 with: - distribution: 'microsoft' - java-version: '11' + distribution: "microsoft" + java-version: "11" - name: Get yarn cache directory path id: fabric-yarn-cache-dir-path @@ -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 ../.. \ No newline at end of file + run: cd FabricExample/android && ./gradlew assembleDebug --build-cache -PreactNativeArchitectures=arm64-v8a && cd ../.. diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml index 3c5bda6b6..cb424c127 100644 --- a/.github/workflows/build-android.yml +++ b/.github/workflows/build-android.yml @@ -5,18 +5,18 @@ on: branches: - main paths: - - '.github/workflows/build-android.yml' - - 'android/**' - - 'example/android/**' - - 'yarn.lock' - - 'example/yarn.lock' + - ".github/workflows/build-android.yml" + - "android/**" + - "example/android/**" + - "yarn.lock" + - "example/yarn.lock" pull_request: paths: - - '.github/workflows/build-android.yml' - - 'android/**' - - 'example/android/**' - - 'yarn.lock' - - 'example/yarn.lock' + - ".github/workflows/build-android.yml" + - "android/**" + - "example/android/**" + - "yarn.lock" + - "example/yarn.lock" jobs: build: @@ -28,8 +28,8 @@ jobs: - name: Setup JDK 11 uses: actions/setup-java@v3 with: - distribution: 'microsoft' - java-version: '11' + distribution: "microsoft" + java-version: "11" - name: Get yarn cache directory path id: yarn-cache-dir-path @@ -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 ../.. \ No newline at end of file + run: cd example/android && ./gradlew assembleDebug --build-cache && cd ../.. diff --git a/.github/workflows/build-ios-fabric.yml b/.github/workflows/build-ios-fabric.yml index 88998491d..94422a5f6 100644 --- a/.github/workflows/build-ios-fabric.yml +++ b/.github/workflows/build-ios-fabric.yml @@ -5,24 +5,24 @@ on: branches: - main paths: - - '.github/workflows/build-ios-fabric.yml' - - 'react-native-keyboard-controller.podspec' - - 'ios/**' - - 'FabricExample/ios/**' - - 'yarn.lock' - - 'FabricExample/yarn.lock' - - 'src/specs/**' + - ".github/workflows/build-ios-fabric.yml" + - "react-native-keyboard-controller.podspec" + - "ios/**" + - "FabricExample/ios/**" + - "yarn.lock" + - "FabricExample/yarn.lock" + - "src/specs/**" pull_request: branches: - main paths: - - '.github/workflows/build-ios-fabric.yml' - - 'react-native-keyboard-controller.podspec' - - 'ios/**' - - 'FabricExample/ios/**' - - 'yarn.lock' - - 'FabricExample/yarn.lock' - - 'src/specs/**' + - ".github/workflows/build-ios-fabric.yml" + - "react-native-keyboard-controller.podspec" + - "ios/**" + - "FabricExample/ios/**" + - "yarn.lock" + - "FabricExample/yarn.lock" + - "src/specs/**" jobs: build: @@ -85,4 +85,4 @@ jobs: -configuration Debug \ -destination 'platform=iOS Simulator,name=iPhone 11 Pro' \ build \ - CODE_SIGNING_ALLOWED=NO | xcpretty" \ No newline at end of file + CODE_SIGNING_ALLOWED=NO | xcpretty" diff --git a/.github/workflows/build-ios.yml b/.github/workflows/build-ios.yml index 9c22f080f..8d5c634c2 100644 --- a/.github/workflows/build-ios.yml +++ b/.github/workflows/build-ios.yml @@ -5,22 +5,22 @@ on: branches: - main paths: - - '.github/workflows/build-ios.yml' - - 'react-native-keyboard-controller.podspec' - - 'ios/**' - - 'example/ios/**' - - 'yarn.lock' - - 'example/yarn.lock' + - ".github/workflows/build-ios.yml" + - "react-native-keyboard-controller.podspec" + - "ios/**" + - "example/ios/**" + - "yarn.lock" + - "example/yarn.lock" pull_request: branches: - main paths: - - '.github/workflows/build-ios.yml' - - 'react-native-keyboard-controller.podspec' - - 'ios/**' - - 'example/ios/**' - - 'yarn.lock' - - 'example/yarn.lock' + - ".github/workflows/build-ios.yml" + - "react-native-keyboard-controller.podspec" + - "ios/**" + - "example/ios/**" + - "yarn.lock" + - "example/yarn.lock" jobs: build: @@ -81,4 +81,4 @@ jobs: -configuration Debug \ -destination 'platform=iOS Simulator,name=iPhone 11 Pro' \ build \ - CODE_SIGNING_ALLOWED=NO | xcpretty" \ No newline at end of file + CODE_SIGNING_ALLOWED=NO | xcpretty" diff --git a/.github/workflows/compress-images.yml b/.github/workflows/compress-images.yml index d03a76b76..15f495abb 100644 --- a/.github/workflows/compress-images.yml +++ b/.github/workflows/compress-images.yml @@ -4,11 +4,11 @@ on: # Run Image Actions when JPG, JPEG, PNG or WebP files are added or changed. # See https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#onpushpull_requestpaths for reference. paths: - - '.github/workflows/compress-images.yml' - - '**.jpg' - - '**.jpeg' - - '**.png' - - '**.webp' + - ".github/workflows/compress-images.yml" + - "**.jpg" + - "**.jpeg" + - "**.png" + - "**.webp" jobs: compress-images: @@ -26,8 +26,8 @@ jobs: # The `GITHUB_TOKEN` is automatically generated by GitHub and scoped only to the repository that is currently running the action. By default, the action can’t update Pull Requests initiated from forked repositories. # See https://docs.github.com/en/actions/reference/authentication-in-a-workflow and https://help.github.com/en/articles/virtual-environments-for-github-actions#token-permissions githubToken: ${{ secrets.GITHUB_TOKEN }} - ignorePaths: 'e2e/**' - jpegQuality: '80' + ignorePaths: "e2e/**" + jpegQuality: "80" jpegProgressive: false - pngQuality: '80' - webpQuality: '80' \ No newline at end of file + pngQuality: "80" + webpQuality: "80" diff --git a/.github/workflows/compress-lottie.yml b/.github/workflows/compress-lottie.yml index ab315abf1..d95a6494d 100644 --- a/.github/workflows/compress-lottie.yml +++ b/.github/workflows/compress-lottie.yml @@ -2,8 +2,8 @@ name: πŸ“¦ Compress Docs on: pull_request: paths: - - '.github/workflows/compress-lottie.yml' - - '**.lottie.json' + - ".github/workflows/compress-lottie.yml" + - "**.lottie.json" jobs: compress-lottie: @@ -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 \ No newline at end of file + run: git diff --exit-code HEAD diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index a08004203..6799cf687 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -5,8 +5,8 @@ on: branches: - main paths: - - '.github/workflows/deploy-docs.yml' - - 'docs/**' + - ".github/workflows/deploy-docs.yml" + - "docs/**" # Review gh actions docs if you want to further define triggers, paths, etc # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on @@ -21,7 +21,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 16.x + node-version: 18.x cache: yarn - name: Install dependencies run: yarn install --frozen-lockfile @@ -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 \ No newline at end of file + user_email: 41898282+github-actions[bot]@users.noreply.github.com diff --git a/.github/workflows/docs-e2e.yml b/.github/workflows/docs-e2e.yml index afcad35fb..f943102f6 100644 --- a/.github/workflows/docs-e2e.yml +++ b/.github/workflows/docs-e2e.yml @@ -4,13 +4,13 @@ on: push: branches: [main] paths: - - '.github/workflows/docs-e2e.yml' - - 'docs/**' + - ".github/workflows/docs-e2e.yml" + - "docs/**" pull_request: branches: [main] paths: - - '.github/workflows/docs-e2e.yml' - - 'docs/**' + - ".github/workflows/docs-e2e.yml" + - "docs/**" jobs: take-screenshots: @@ -43,4 +43,4 @@ jobs: run: yarn playwright test - name: Upload screenshots to Argos - run: yarn argos upload ./screenshots \ No newline at end of file + run: yarn argos upload ./screenshots diff --git a/.github/workflows/ios-e2e-test.yml b/.github/workflows/ios-e2e-test.yml index eaf2861f8..54bf4e6f4 100644 --- a/.github/workflows/ios-e2e-test.yml +++ b/.github/workflows/ios-e2e-test.yml @@ -2,24 +2,24 @@ name: πŸ›  iOS e2e tests on: pull_request: paths: - - '.github/workflows/ios-e2e-test.yml' - - 'react-native-keyboard-controller.podspec' - - 'package.json' - - 'ios/**' - - 'example/**' - - 'e2e/**' - - 'src/**' + - ".github/workflows/ios-e2e-test.yml" + - "react-native-keyboard-controller.podspec" + - "package.json" + - "ios/**" + - "example/**" + - "e2e/**" + - "src/**" push: branches: - main paths: - - '.github/workflows/ios-e2e-test.yml' - - 'react-native-keyboard-controller.podspec' - - 'package.json' - - 'ios/**' - - 'example/**' - - 'e2e/**' - - 'src/**' + - ".github/workflows/ios-e2e-test.yml" + - "react-native-keyboard-controller.podspec" + - "package.json" + - "ios/**" + - "example/**" + - "e2e/**" + - "src/**" jobs: test: @@ -29,14 +29,14 @@ 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 with: - node-version: 16.x - cache: 'yarn' + node-version: 18.x + cache: "yarn" - name: Get Xcode version run: xcodebuild -version - name: Install AppleSimulatorUtils @@ -81,7 +81,7 @@ 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 @@ -89,4 +89,4 @@ jobs: if: ${{ failure() }} with: name: ios-fail-screen-shoots - path: e2e/artifacts \ No newline at end of file + path: e2e/artifacts diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f802501e0..5c0be9be8 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,10 +11,10 @@ jobs: # Setup .npmrc file to publish to npm - uses: actions/setup-node@v3 with: - node-version: '16.x' - registry-url: 'https://registry.npmjs.org' + node-version: "18.x" + registry-url: "https://registry.npmjs.org" cache: yarn - run: yarn install --frozen-lockfile - run: npm publish env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/size-diff.yml b/.github/workflows/size-diff.yml index 309ce6ac9..48d4d5819 100644 --- a/.github/workflows/size-diff.yml +++ b/.github/workflows/size-diff.yml @@ -3,9 +3,9 @@ name: πŸ§ͺ Size diff on: pull_request: paths-ignore: - - 'example/**' - - 'FabricExample/**' - - 'docs/**' + - "example/**" + - "FabricExample/**" + - "docs/**" jobs: check-diff: @@ -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 }} | \ No newline at end of file + | ${{ env.NEW_SIZE }} bytes | ${{ env.OLD_SIZE }} bytes | ${{ env.DIFF }} bytes ${{ env.SIGN }} | diff --git a/.github/workflows/verify-android.yml b/.github/workflows/verify-android.yml index 24260abef..08a376044 100644 --- a/.github/workflows/verify-android.yml +++ b/.github/workflows/verify-android.yml @@ -5,14 +5,14 @@ on: branches: - main paths: - - '.github/workflows/verify-android.yml' - - 'android/**' + - ".github/workflows/verify-android.yml" + - "android/**" pull_request: branches: - main paths: - - '.github/workflows/verify-android.yml' - - 'android/**' + - ".github/workflows/verify-android.yml" + - "android/**" jobs: ktlint: @@ -35,8 +35,8 @@ jobs: - name: Setup JDK 11 uses: actions/setup-java@v3 with: - distribution: 'microsoft' - java-version: '11' + distribution: "microsoft" + java-version: "11" - name: Install dependencies run: yarn install --frozen-lockfile --cwd .. - name: Run Gradle Lint @@ -52,8 +52,8 @@ jobs: - name: Setup JDK 11 uses: actions/setup-java@v3 with: - distribution: 'microsoft' - java-version: '11' + distribution: "microsoft" + java-version: "11" - name: Install dependencies run: yarn install --frozen-lockfile --cwd .. - name: Run Gradle Lint @@ -69,8 +69,8 @@ jobs: - name: Setup JDK 11 uses: actions/setup-java@v3 with: - distribution: 'microsoft' - java-version: '11' + distribution: "microsoft" + java-version: "11" - name: Install Detekt run: | curl -sSLO https://github.com/detekt/detekt/releases/download/v1.23.1/detekt-cli-1.23.1.zip diff --git a/.github/workflows/verify-cpp.yml b/.github/workflows/verify-cpp.yml index c83431339..f1da702fe 100644 --- a/.github/workflows/verify-cpp.yml +++ b/.github/workflows/verify-cpp.yml @@ -5,12 +5,12 @@ on: branches: - main paths: - - '.github/workflows/verify-cpp.yml' - - 'android/src/main/**' + - ".github/workflows/verify-cpp.yml" + - "android/src/main/**" pull_request: paths: - - '.github/workflows/verify-cpp.yml' - - 'android/src/main/**' + - ".github/workflows/verify-cpp.yml" + - "android/src/main/**" jobs: lint: @@ -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/ \ No newline at end of file + 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/ diff --git a/.github/workflows/verify-docs.yml b/.github/workflows/verify-docs.yml index 7b462f9f4..a1b78dfed 100644 --- a/.github/workflows/verify-docs.yml +++ b/.github/workflows/verify-docs.yml @@ -5,8 +5,8 @@ on: branches: - main paths: - - '.github/workflows/verify-docs.yml' - - 'docs/**' + - ".github/workflows/verify-docs.yml" + - "docs/**" types: - opened - reopened @@ -24,7 +24,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 16.x + node-version: 18.x cache: yarn - name: Install dependencies run: yarn install --frozen-lockfile @@ -40,7 +40,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 16.x + node-version: 18.x cache: yarn - name: Install dependencies run: yarn install --frozen-lockfile @@ -57,7 +57,7 @@ jobs: - run: echo "PREVIEW_PATH=pr-preview/pr-${{ github.event.number }}" >> "$GITHUB_ENV" - uses: actions/setup-node@v3 with: - node-version: 16.x + node-version: 18.x cache: yarn - name: Install dependencies run: yarn install --frozen-lockfile @@ -66,4 +66,4 @@ jobs: - name: Deploy preview uses: rossjrw/pr-preview-action@v1 with: - source-dir: ./docs/build/ \ No newline at end of file + source-dir: ./docs/build/ diff --git a/.github/workflows/verify-ios.yml b/.github/workflows/verify-ios.yml index 9b93e35ea..3e87a602c 100644 --- a/.github/workflows/verify-ios.yml +++ b/.github/workflows/verify-ios.yml @@ -5,14 +5,14 @@ on: branches: - main paths: - - '.github/workflows/verify-ios.yml' - - 'ios/**' + - ".github/workflows/verify-ios.yml" + - "ios/**" pull_request: branches: - main paths: - - '.github/workflows/verify-ios.yml' - - 'ios/**' + - ".github/workflows/verify-ios.yml" + - "ios/**" jobs: swift-lint: diff --git a/.github/workflows/verify-js.yml b/.github/workflows/verify-js.yml index 1afe8d1b5..30e42c57d 100644 --- a/.github/workflows/verify-js.yml +++ b/.github/workflows/verify-js.yml @@ -16,7 +16,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 16.x + node-version: 18.x cache: yarn - name: Install dependencies run: | @@ -32,12 +32,14 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 16.x + node-version: 18.x cache: yarn - name: Install dependencies run: yarn install --frozen-lockfile - name: Run Lint run: yarn lint + - name: Check formatting + run: yarn prettier '**/*' --ignore-unknown --check tests: name: πŸ“– Unit tests runs-on: ubuntu-latest @@ -45,7 +47,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 16.x + node-version: 18.x cache: yarn - name: Install dependencies run: | diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 000000000..b8b9f386e --- /dev/null +++ b/.prettierignore @@ -0,0 +1,18 @@ +Pods/ +docs/.docusaurus/ +lib/ +node_modules/ + +*.lottie.json + +example/android/build/ +example/android/app/build/ +example/ios/build/ +example/src/**/Lottie/*.json + +FabricExample/android/build/ +FabricExample/android/app/ +FabricExample/ios/build/ +FabricExample/src/**/Lottie/*.json + +android/build/ diff --git a/FabricExample/.watchmanconfig b/FabricExample/.watchmanconfig index 9e26dfeeb..0967ef424 100644 --- a/FabricExample/.watchmanconfig +++ b/FabricExample/.watchmanconfig @@ -1 +1 @@ -{} \ No newline at end of file +{} diff --git a/FabricExample/__tests__/basic-interaction.spec.tsx b/FabricExample/__tests__/basic-interaction.spec.tsx index a11939ffd..7509c1ea0 100644 --- a/FabricExample/__tests__/basic-interaction.spec.tsx +++ b/FabricExample/__tests__/basic-interaction.spec.tsx @@ -1,9 +1,8 @@ -import '@testing-library/jest-native/extend-expect'; -import React from 'react'; -import { Animated } from 'react-native'; -import { render } from '@testing-library/react-native'; - -import { useKeyboardAnimation } from 'react-native-keyboard-controller'; +import "@testing-library/jest-native/extend-expect"; +import { render } from "@testing-library/react-native"; +import React from "react"; +import { Animated } from "react-native"; +import { useKeyboardAnimation } from "react-native-keyboard-controller"; function TestComponent() { const { height } = useKeyboardAnimation(); @@ -16,11 +15,11 @@ function TestComponent() { ); } -describe('basic keyboard interaction', () => { - it('should have different styles depends on position', () => { +describe("basic keyboard interaction", () => { + it("should have different styles depends on position", () => { const { getByTestId, update } = render(); - expect(getByTestId('view')).toHaveStyle({ transform: [{ translateY: 0 }] }); + expect(getByTestId("view")).toHaveStyle({ transform: [{ translateY: 0 }] }); (useKeyboardAnimation as jest.Mock).mockReturnValue({ height: new Animated.Value(150), @@ -28,7 +27,7 @@ describe('basic keyboard interaction', () => { }); update(); - expect(getByTestId('view')).toHaveStyle({ + expect(getByTestId("view")).toHaveStyle({ transform: [{ translateY: 150 }], }); @@ -38,7 +37,7 @@ describe('basic keyboard interaction', () => { }); update(); - expect(getByTestId('view')).toHaveStyle({ + expect(getByTestId("view")).toHaveStyle({ transform: [{ translateY: 300 }], }); }); diff --git a/FabricExample/__tests__/close-keyboard.spec.tsx b/FabricExample/__tests__/close-keyboard.spec.tsx index 0ad47bb85..d3c9437d0 100644 --- a/FabricExample/__tests__/close-keyboard.spec.tsx +++ b/FabricExample/__tests__/close-keyboard.spec.tsx @@ -1,24 +1,23 @@ -import React from 'react'; -import { Button } from 'react-native'; -import { fireEvent, render } from '@testing-library/react-native'; - -import { KeyboardController } from 'react-native-keyboard-controller'; +import { fireEvent, render } from "@testing-library/react-native"; +import React from "react"; +import { Button } from "react-native"; +import { KeyboardController } from "react-native-keyboard-controller"; function CloseKeyboard() { return (