Skip to content

🎥 Make videos programmatically with React

move convert

Jonny Burger1fa21d01caab
diff --git a/packages/convert/.eslintrc b/packages/convert/.eslintrc
deleted file mode 100644
index 644af06a99..0000000000
--- a/packages/convert/.eslintrc
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "extends": "@remotion",
-}
diff --git a/packages/convert/app/components/ConvertUi.tsx b/packages/convert/app/components/ConvertUi.tsx
index 3b73f012d8..9ca60a75a0 100644
--- a/packages/convert/app/components/ConvertUi.tsx
+++ b/packages/convert/app/components/ConvertUi.tsx
@@ -48,7 +48,7 @@ import {RotateComponents} from './RotateComponents';
import {useSupportedConfigs} from './use-supported-configs';
import type {VideoThumbnailRef} from './VideoThumbnail';
-export default function ConvertUI({
+const ConvertUI = ({
src,
currentAudioCodec,
currentVideoCodec,
@@ -94,7 +94,7 @@ export default function ConvertUI({
readonly flipVertical: boolean;
readonly setFlipHorizontal: React.Dispatch<React.SetStateAction<boolean>>;
readonly setFlipVertical: React.Dispatch<React.SetStateAction<boolean>>;
-}) {
+}) => {
const [outputContainer, setContainer] = useState<ConvertMediaContainer>(() =>
getDefaultContainerForConversion(src, action),
);
@@ -583,4 +583,6 @@ export default function ConvertUI({
</Button>
</>
);
-}
+};
+
+export default ConvertUI;
diff --git a/packages/convert/app/components/Probe.tsx b/packages/convert/app/components/Probe.tsx
index b490d188d0..c843c88236 100644
--- a/packages/convert/app/components/Probe.tsx
+++ b/packages/convert/app/components/Probe.tsx
@@ -1,4 +1,3 @@
-/* eslint-disable complexity */
import type {MediaParserEmbeddedImage} from '@remotion/media-parser';
import clsx from 'clsx';
import React, {useCallback, useMemo, useRef, useState} from 'react';
diff --git a/packages/convert/app/components/ui/badge.tsx b/packages/convert/app/components/ui/badge.tsx
index 9b213de3f3..ea693ae125 100644
--- a/packages/convert/app/components/ui/badge.tsx
+++ b/packages/convert/app/components/ui/badge.tsx
@@ -1,36 +1,34 @@
-import * as React from "react"
-import { cva, type VariantProps } from "class-variance-authority"
+import {cva, type VariantProps} from 'class-variance-authority';
+import * as React from 'react';
-import { cn } from "~/lib/utils"
+import {cn} from '~/lib/utils';
const badgeVariants = cva(
- "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
- {
- variants: {
- variant: {
- default:
- "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
- secondary:
- "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
- destructive:
- "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
- outline: "text-foreground",
- },
- },
- defaultVariants: {
- variant: "default",
- },
- }
-)
+ 'inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',
+ {
+ variants: {
+ variant: {
+ default:
+ 'border-transparent bg-primary text-primary-foreground hover:bg-primary/80',
+ secondary:
+ 'border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80',
+ destructive:
+ 'border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80',
+ outline: 'text-foreground',
+ },
+ },
+ defaultVariants: {
+ variant: 'default',
+ },
+ },
+);
export interface BadgeProps
- extends React.HTMLAttributes<HTMLDivElement>,
- VariantProps<typeof badgeVariants> {}
+ extends React.HTMLAttributes<HTMLDivElement>,
+ VariantProps<typeof badgeVariants> {}
-function Badge({ className, variant, ...props }: BadgeProps) {
- return (
- <div className={cn(badgeVariants({ variant }), className)} {...props} />
- )
-}
+const Badge = ({className, variant, ...props}: BadgeProps) => {
+ return <div className={cn(badgeVariants({variant}), className)} {...props} />;
+};
-export { Badge, badgeVariants }
+export {Badge, badgeVariants};
diff --git a/packages/convert/app/components/ui/button.tsx b/packages/convert/app/components/ui/button.tsx
index 2fcfa697ee..8711783ff0 100644
--- a/packages/convert/app/components/ui/button.tsx
+++ b/packages/convert/app/components/ui/button.tsx
@@ -40,6 +40,7 @@ const buttonVariants = cva(
export interface ButtonProps
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
VariantProps<typeof buttonVariants> {
+ // eslint-disable-next-line react/require-default-props
readonly asChild?: boolean;
}
diff --git a/packages/convert/app/components/ui/skeleton.tsx b/packages/convert/app/components/ui/skeleton.tsx
index f674e0e26b..784d1d3a8f 100644
--- a/packages/convert/app/components/ui/skeleton.tsx
+++ b/packages/convert/app/components/ui/skeleton.tsx
@@ -1,12 +1,15 @@
import {cn} from '~/lib/utils';
-function Skeleton({className, ...props}: React.HTMLAttributes<HTMLDivElement>) {
+const Skeleton = ({
+ className,
+ ...props
+}: React.HTMLAttributes<HTMLDivElement>) => {
return (
<div
className={cn('rounded-md bg-muted border-black/15 border', className)}
{...props}
/>
);
-}
+};
export {Skeleton};
diff --git a/packages/convert/app/lib/render-metadata-label.ts b/packages/convert/app/lib/render-metadata-label.ts
index 5cd2ba6d3f..f58054c35a 100644
--- a/packages/convert/app/lib/render-metadata-label.ts
+++ b/packages/convert/app/lib/render-metadata-label.ts
@@ -1,6 +1,5 @@
import type {MediaParserLocation, MetadataEntry} from '@remotion/media-parser';
-/* eslint-disable complexity */
export const renderMetadataLabel = (key: string) => {
if (key === 'com.apple.quicktime.location.accuracy.horizontal') {
return 'Location Accuracy (Horizontal)';
diff --git a/packages/convert/app/root.tsx b/packages/convert/app/root.tsx
index 6fa04261cb..f4efe9bbfe 100644
--- a/packages/convert/app/root.tsx
+++ b/packages/convert/app/root.tsx
@@ -3,7 +3,7 @@ import './tailwind.css';
import {Links, Outlet, Scripts, ScrollRestoration} from '@remix-run/react';
-export function Layout({children}: {readonly children: React.ReactNode}) {
+export const Layout = ({children}: {readonly children: React.ReactNode}) => {
return (
<html lang="en">
<head>
@@ -25,8 +25,10 @@ export function Layout({children}: {readonly children: React.ReactNode}) {
</body>
</html>
);
-}
+};
-export default function App() {
+const App = () => {
return <Outlet />;
-}
+};
+
+export default App;
diff --git a/packages/convert/app/service-worker.ts b/packages/convert/app/service-worker.ts
index 37ba061836..eea9afac14 100644
--- a/packages/convert/app/service-worker.ts
+++ b/packages/convert/app/service-worker.ts
@@ -1,4 +1,3 @@
-// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-nocheck
const $FILES = [];
// ^ leave this - will get filled in during build
diff --git a/packages/convert/eslint.config.mjs b/packages/convert/eslint.config.mjs
index 80763ec8ee..ffd9f26ea7 100644
--- a/packages/convert/eslint.config.mjs
+++ b/packages/convert/eslint.config.mjs
@@ -2,12 +2,12 @@ import {remotionFlatConfig} from '@remotion/eslint-config-internal';
const config = remotionFlatConfig({react: true});
-export default {
+const flatConfig = {
...config,
rules: {
...config.rules,
'no-console': 'error',
- 'react/function-component-definition': 'off',
- 'react/require-default-props': 'off',
},
};
+
+export default flatConfig;
diff --git a/packages/convert/package.json b/packages/convert/package.json
index ee023e8ec6..3fe4a9ef3e 100644
--- a/packages/convert/package.json
+++ b/packages/convert/package.json
@@ -42,7 +42,7 @@
"@remix-run/dev": "^2.15.2",
"@remotion/eslint-config-internal": "workspace:*",
"autoprefixer": "10.4.20",
- "eslint": "8.57.1",
+ "eslint": "9.14.0",
"postcss": "8.4.47",
"tailwindcss": "3.4.13",
"vite": "^5.4.12",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index fc486f0ef6..72190fcde5 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -459,8 +459,8 @@ importers:
specifier: 10.4.20
version: 10.4.20([email protected])
eslint:
- specifier: 8.57.1
- version: 8.57.1
+ specifier: 9.14.0
+ version: 9.14.0
postcss:
specifier: 8.4.47
version: 8.4.47