Skip to content

Commit

Permalink
chore: Remove semicolons (mrousavy#1846)
Browse files Browse the repository at this point in the history
* chore: Disable `semi` in Prettier

* chore: Format w/o semi

* Remove more `;`

* Lint example

* More ;
  • Loading branch information
mrousavy authored Sep 26, 2023
1 parent f7428f2 commit 14721d3
Show file tree
Hide file tree
Showing 69 changed files with 998 additions and 999 deletions.
2 changes: 1 addition & 1 deletion docs/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
}
2 changes: 1 addition & 1 deletion docs/docs/guides/CAPTURING.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Taking Photos/Recording Videos
sidebar_label: Taking Photos/Recording Videos
---

import useBaseUrl from '@docusaurus/useBaseUrl';
import useBaseUrl from '@docusaurus/useBaseUrl'

<div>
<svg xmlns="http://www.w3.org/2000/svg" width="283" height="535" style={{ float: 'right' }}>
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/guides/DEVICES.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ title: Camera Devices
sidebar_label: Camera Devices
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import useBaseUrl from '@docusaurus/useBaseUrl';
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
import useBaseUrl from '@docusaurus/useBaseUrl'

<div>
<svg xmlns="http://www.w3.org/2000/svg" width="283" height="535" style={{ float: 'right' }}>
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/guides/ERRORS.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Camera Errors
sidebar_label: Camera Errors
---

import useBaseUrl from '@docusaurus/useBaseUrl';
import useBaseUrl from '@docusaurus/useBaseUrl'

<div>
<img align="right" width="283" src={useBaseUrl("img/example_error.png")} />
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/guides/FORMATS.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ title: Camera Formats
sidebar_label: Camera Formats
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import useBaseUrl from '@docusaurus/useBaseUrl';
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
import useBaseUrl from '@docusaurus/useBaseUrl'

<div>
<img align="right" width="283" src={useBaseUrl("img/example.png")} />
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/guides/FRAME_PROCESSORS.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ title: Frame Processors
sidebar_label: Frame Processors
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import useBaseUrl from '@docusaurus/useBaseUrl';
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
import useBaseUrl from '@docusaurus/useBaseUrl'

<div>
<svg xmlns="http://www.w3.org/2000/svg" width="283" height="535" style={{ float: 'right' }}>
Expand Down
8 changes: 4 additions & 4 deletions docs/docs/guides/FRAME_PROCESSORS_CREATE_OVERVIEW.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ title: Creating Frame Processor Plugins
sidebar_label: Overview
---

import useBaseUrl from '@docusaurus/useBaseUrl';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import useBaseUrl from '@docusaurus/useBaseUrl'
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'

## Overview

Expand Down Expand Up @@ -80,7 +80,7 @@ Which returns a [`Frame`](https://github.com/mrousavy/react-native-vision-camera

```js
const frameProcessor = useFrameProcessor((frame) => {
'worklet';
'worklet'
// creates a new `Frame` that's 720x480
const resizedFrame = resize(frame, 720, 480)

Expand Down
6 changes: 3 additions & 3 deletions docs/docs/guides/FRAME_PROCESSORS_SKIA.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ title: Drawing to a Frame (Skia)
sidebar_label: Drawing to a Frame (Skia)
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import useBaseUrl from '@docusaurus/useBaseUrl';
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
import useBaseUrl from '@docusaurus/useBaseUrl'

<div>
<svg xmlns="http://www.w3.org/2000/svg" width="283" height="535" style={{ float: 'right' }}>
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/guides/FRAME_PROCESSORS_TIPS.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ title: Frame Processors Tips
sidebar_label: Frame Processors Tips
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import useBaseUrl from '@docusaurus/useBaseUrl';
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
import useBaseUrl from '@docusaurus/useBaseUrl'

## Avoiding Frame-drops

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/guides/FRAME_PROCESSOR_CREATE_PLUGIN_ANDROID.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ title: Creating Frame Processor Plugins
sidebar_label: Creating Frame Processor Plugins (Android)
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'

## Creating a Frame Processor Plugin for Android

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/guides/FRAME_PROCESSOR_CREATE_PLUGIN_IOS.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ title: Creating Frame Processor Plugins
sidebar_label: Creating Frame Processor Plugins (iOS)
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'

## Creating a Frame Processor Plugin for iOS

Expand Down
6 changes: 3 additions & 3 deletions docs/docs/guides/HDR.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ title: HDR
sidebar_label: HDR
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import useBaseUrl from '@docusaurus/useBaseUrl';
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
import useBaseUrl from '@docusaurus/useBaseUrl'

## What is HDR?

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/guides/LIFECYCLE.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Lifecycle
sidebar_label: Lifecycle
---

import useBaseUrl from '@docusaurus/useBaseUrl';
import useBaseUrl from '@docusaurus/useBaseUrl'

<div>
<img align="right" width="283" src={useBaseUrl("img/example.png")} />
Expand Down
42 changes: 19 additions & 23 deletions docs/docs/guides/MOCKING.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Mocking
sidebar_label: Mocking
---

import useBaseUrl from '@docusaurus/useBaseUrl';
import useBaseUrl from '@docusaurus/useBaseUrl'

<div>
<img align="right" width="283" src={useBaseUrl("img/11_back.png")} />
Expand All @@ -22,8 +22,8 @@ In order to override React Native modules, allow bundler to use the flag `RN_SRC

Add to your [Metro Config](https://facebook.github.io/metro/docs/configuration/):
```js
const { getDefaultConfig } = require("metro-config");
const { resolver: defaultResolver } = getDefaultConfig.getDefaultValues();
const { getDefaultConfig } = require("metro-config")
const { resolver: defaultResolver } = getDefaultConfig.getDefaultValues()

module.exports = {
...
Expand All @@ -34,8 +34,7 @@ module.exports = {
...defaultResolver.sourceExts,
],
},
};

}
```

### Create proxy for original and mocked modules
Expand All @@ -51,19 +50,18 @@ Define your mocks following the [original definitions](https://github.com/mrousa
```js
// vision-camera.js

import { Camera, sortDevices } from 'react-native-vision-camera';
import { Camera, sortDevices } from 'react-native-vision-camera'

export const VisionCamera = Camera;
export const visionCameraSortDevices = sortDevices;
export const VisionCamera = Camera
```

```js
// vision-camera.e2e.js

import React from 'react';
import RNFS, { writeFile } from 'react-native-fs';
import React from 'react'
import RNFS, { writeFile } from 'react-native-fs'

console.log('[DETOX] Using mocked react-native-vision-camera');
console.log('[DETOX] Using mocked react-native-vision-camera')

export class VisionCamera extends React.PureComponent {
static getAvailableCameraDevices() {
Expand All @@ -73,32 +71,30 @@ export class VisionCamera extends React.PureComponent {
position: 'back',
},
]
);
)
}

static async getCameraPermissionStatus() {
return 'granted';
return 'granted'
}

static async requestCameraPermission() {
return 'granted';
return 'granted'
}

async takePhoto() {
const writePath = `${RNFS.DocumentDirectoryPath}/simulated_camera_photo.png`;
const writePath = `${RNFS.DocumentDirectoryPath}/simulated_camera_photo.png`

const imageDataBase64 = 'some_large_base_64_encoded_simulated_camera_photo';
await writeFile(writePath, imageDataBase64, 'base64');
const imageDataBase64 = 'some_large_base_64_encoded_simulated_camera_photo'
await writeFile(writePath, imageDataBase64, 'base64')

return { path: writePath };
return { path: writePath }
}

render() {
return null;
return null
}
}

export const visionCameraSortDevices = (_left, _right) => 1;
```

These mocked modules allows us to get granted camera permissions, get one back camera
Expand All @@ -111,10 +107,10 @@ we must reference the proxy module.

```ts
// before
import { Camera } from 'react-native-vision-camera';
import { Camera } from 'react-native-vision-camera'

// now
import { VisionCamera } from '/your_path_to_created_folder/vision-camera/vision-camera';
import { VisionCamera } from '/your_path_to_created_folder/vision-camera/vision-camera'
```

### Trigger
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/guides/PERFORMANCE.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ title: Performance
sidebar_label: Performance
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import useBaseUrl from '@docusaurus/useBaseUrl';
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
import useBaseUrl from '@docusaurus/useBaseUrl'

## Performance of VisionCamera

Expand Down
6 changes: 3 additions & 3 deletions docs/docs/guides/SETUP.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ sidebar_label: Getting Started
slug: /guides
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import useBaseUrl from '@docusaurus/useBaseUrl';
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
import useBaseUrl from '@docusaurus/useBaseUrl'

<div>
<img align="right" width="283" src={useBaseUrl("img/example_intro.png")} />
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/guides/STABILIZATION.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ title: Video Stabilization
sidebar_label: Video Stabilization
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import useBaseUrl from '@docusaurus/useBaseUrl';
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
import useBaseUrl from '@docusaurus/useBaseUrl'

## What is Video Stabilization?

Expand Down
6 changes: 3 additions & 3 deletions docs/docs/guides/TROUBLESHOOTING.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ title: Troubleshooting
sidebar_label: Troubleshooting
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import useBaseUrl from '@docusaurus/useBaseUrl';
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
import useBaseUrl from '@docusaurus/useBaseUrl'

<div>
<img align="right" width="283" src={useBaseUrl("img/11_back.png")} />
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/guides/ZOOMING.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Zooming
sidebar_label: Zooming
---

import useBaseUrl from '@docusaurus/useBaseUrl';
import useBaseUrl from '@docusaurus/useBaseUrl'

<div>
<svg xmlns="http://www.w3.org/2000/svg" width="283" height="535" style={{ float: 'right' }}>
Expand Down
2 changes: 1 addition & 1 deletion docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,4 @@ module.exports = {
},
],
],
};
}
2 changes: 1 addition & 1 deletion docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ module.exports = {
}
],
},
};
}
28 changes: 14 additions & 14 deletions docs/src/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from 'react';
import clsx from 'clsx';
import Layout from '@theme/Layout';
import Link from '@docusaurus/Link';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import useBaseUrl from '@docusaurus/useBaseUrl';
import styles from './styles.module.css';
import React from 'react'
import clsx from 'clsx'
import Layout from '@theme/Layout'
import Link from '@docusaurus/Link'
import useDocusaurusContext from '@docusaurus/useDocusaurusContext'
import useBaseUrl from '@docusaurus/useBaseUrl'
import styles from './styles.module.css'
import { Analytics } from '@vercel/analytics/react'

const features = [
Expand Down Expand Up @@ -35,10 +35,10 @@ const features = [
</>
),
},
];
]

function Feature({imageUrl, title, description}) {
const imgUrl = useBaseUrl(imageUrl);
const imgUrl = useBaseUrl(imageUrl)
return (
<div className={clsx('col col--4', styles.feature)}>
{imgUrl && (
Expand All @@ -49,12 +49,12 @@ function Feature({imageUrl, title, description}) {
<h3>{title}</h3>
<p>{description}</p>
</div>
);
)
}

function Home() {
const context = useDocusaurusContext();
const {siteConfig = {}} = context;
const context = useDocusaurusContext()
const {siteConfig = {}} = context
return (
<Layout
title="VisionCamera Documentation"
Expand Down Expand Up @@ -91,7 +91,7 @@ function Home() {
<Analytics />
</main>
</Layout>
);
)
}

export default Home;
export default Home
2 changes: 1 addition & 1 deletion package/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ module.exports = {
globals: {
_log: 'readonly',
},
};
}
Loading

0 comments on commit 14721d3

Please sign in to comment.