Skip to content

🎥 Make videos programmatically with React

awesome

Jonny Burgerc16c9f8696c3
diff --git a/packages/bundler/.eslintrc b/packages/bundler/.eslintrc
deleted file mode 100644
index c2ce21dd7a..0000000000
--- a/packages/bundler/.eslintrc
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "extends": "@remotion/internal",
- "rules": {
- "no-restricted-imports": [
- "error",
- {
- "patterns": ["@remotion/*/src/*", "remotion/src/*"],
- },
- ],
- },
-}
diff --git a/packages/bundler/eslint.config.mjs b/packages/bundler/eslint.config.mjs
new file mode 100644
index 0000000000..404c9a0af4
--- /dev/null
+++ b/packages/bundler/eslint.config.mjs
@@ -0,0 +1,16 @@
+import {remotionFlatConfig} from '@remotion/eslint-config-internal';
+
+const config = remotionFlatConfig({react: false});
+
+export default {
+ ...config,
+ rules: {
+ ...config.rules,
+ 'no-restricted-imports': [
+ 'error',
+ {
+ patterns: ['@remotion/*/src/*', 'remotion/src/*'],
+ },
+ ],
+ },
+};
diff --git a/packages/bundler/src/esbuild-loader/index.ts b/packages/bundler/src/esbuild-loader/index.ts
index 737c2cef9b..fcc79a4b45 100644
--- a/packages/bundler/src/esbuild-loader/index.ts
+++ b/packages/bundler/src/esbuild-loader/index.ts
@@ -9,7 +9,7 @@ const isTypescriptInstalled = () => {
try {
require.resolve('typescript');
return true;
- } catch (err) {
+ } catch {
return false;
}
};
diff --git a/packages/bundler/src/read-recursively.ts b/packages/bundler/src/read-recursively.ts
index 29d6a278bb..06a7209b89 100644
--- a/packages/bundler/src/read-recursively.ts
+++ b/packages/bundler/src/read-recursively.ts
@@ -7,7 +7,7 @@ import type {StaticFile} from 'remotion';
const statOrNull = (p: string) => {
try {
return statSync(p);
- } catch (err) {
+ } catch {
return null;
}
};
diff --git a/packages/bundler/src/validate-public-dir.ts b/packages/bundler/src/validate-public-dir.ts
index 5bcabc59f0..fb45659eb0 100644
--- a/packages/bundler/src/validate-public-dir.ts
+++ b/packages/bundler/src/validate-public-dir.ts
@@ -17,7 +17,7 @@ export const validatePublicDir = (p: string) => {
`The public directory was specified as "${p}", and while this path exists on the filesystem, it is not a directory.`,
);
}
- } catch (e) {
+ } catch {
// Path does not exist
// Check if the parent path exists
const parentPath = path.dirname(p);
diff --git a/packages/bundler/src/webpack-cache.ts b/packages/bundler/src/webpack-cache.ts
index e8f8fc8a83..b1fc199baf 100644
--- a/packages/bundler/src/webpack-cache.ts
+++ b/packages/bundler/src/webpack-cache.ts
@@ -7,7 +7,6 @@ type Environment = 'development' | 'production';
type CacheState = 'exists' | 'other-exists' | 'does-not-exist';
declare global {
- // eslint-disable-next-line @typescript-eslint/no-namespace
namespace NodeJS {
interface ProcessVersions {
pnp?: string;
@@ -24,8 +23,7 @@ const getWebpackCacheDir = (remotionRoot: string) => {
if (fs.statSync(path.join(dir, 'package.json')).isFile()) {
break;
}
- // eslint-disable-next-line no-empty
- } catch (e) {}
+ } catch {}
const parent = path.dirname(dir);
if (dir === parent) {
diff --git a/packages/convert/.eslintrc b/packages/convert/.eslintrc
deleted file mode 100644
index 3b4cec3997..0000000000
--- a/packages/convert/.eslintrc
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "extends": ["@remotion/internal/react"],
- "rules": {
- "no-console": "error",
- "react/function-component-definition": "off",
- "react/require-default-props": "off",
- },
-}
diff --git a/packages/convert/eslint.config.mjs b/packages/convert/eslint.config.mjs
new file mode 100644
index 0000000000..fedf94da0b
--- /dev/null
+++ b/packages/convert/eslint.config.mjs
@@ -0,0 +1,13 @@
+import {remotionFlatConfig} from '@remotion/eslint-config-internal';
+
+const config = remotionFlatConfig({react: false});
+
+export default {
+ ...config,
+ rules: {
+ ...config.rules,
+ 'no-console': 'error',
+ 'react/function-component-definition': 'off',
+ 'react/require-default-props': 'off',
+ },
+};
diff --git a/packages/convert/package.json b/packages/convert/package.json
index 503b8c064d..28eac63192 100644
--- a/packages/convert/package.json
+++ b/packages/convert/package.json
@@ -7,7 +7,7 @@
"scripts": {
"build-page": "remix vite:build",
"dev": "remix vite:dev",
- "lint": "eslint --ignore-path .gitignore --cache --cache-location ./node_modules/.cache/eslint .",
+ "lint": "eslint --cache --cache-location ./node_modules/.cache/eslint .",
"typecheck": "tsc"
},
"dependencies": {
diff --git a/packages/shapes/.eslintrc b/packages/shapes/.eslintrc
deleted file mode 100644
index 73622c15e7..0000000000
--- a/packages/shapes/.eslintrc
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "extends": "@remotion/internal/react",
- "rules": {
- "no-bitwise": "off",
- },
-}
diff --git a/packages/shapes/eslint.config.mjs b/packages/shapes/eslint.config.mjs
new file mode 100644
index 0000000000..ab29acaba0
--- /dev/null
+++ b/packages/shapes/eslint.config.mjs
@@ -0,0 +1,7 @@
+import {remotionFlatConfig} from '@remotion/eslint-config-internal';
+
+const config = remotionFlatConfig({react: true});
+
+export default {
+ ...config,
+};
diff --git a/packages/shapes/src/components/render-svg.tsx b/packages/shapes/src/components/render-svg.tsx
index 2359eee9d2..3e514e5aa6 100644
--- a/packages/shapes/src/components/render-svg.tsx
+++ b/packages/shapes/src/components/render-svg.tsx
@@ -7,8 +7,8 @@ export type AllShapesProps = Omit<
React.SVGProps<SVGPathElement>,
'width' | 'height' | 'd'
> & {
- debug?: boolean;
- pathStyle?: React.CSSProperties;
+ readonly debug?: boolean;
+ readonly pathStyle?: React.CSSProperties;
};
export const RenderSvg = ({
@@ -22,11 +22,11 @@ export const RenderSvg = ({
instructions,
...props
}: {
- width: number;
- height: number;
- path: string;
- instructions: Instruction[];
- transformOrigin: string;
+ readonly width: number;
+ readonly height: number;
+ readonly path: string;
+ readonly instructions: Instruction[];
+ readonly transformOrigin: string;
} & AllShapesProps) => {
const actualStyle = useMemo((): React.CSSProperties => {
return {
diff --git a/packages/shapes/src/test/test-utils.tsx b/packages/shapes/src/test/test-utils.tsx
index 46918cb65d..eb7ad4e93d 100644
--- a/packages/shapes/src/test/test-utils.tsx
+++ b/packages/shapes/src/test/test-utils.tsx
@@ -6,7 +6,7 @@ const AllTheProviders: FC<{
readonly children: React.ReactNode;
}> = ({children}) => {
// overwriting console.error console does not gets poluted with all the errors
- // eslint-disable-next-line @typescript-eslint/no-empty-function
+
window.console.error = () => {};
return <div>{children}</div>;
};
diff --git a/packages/shapes/src/utils/make-triangle.ts b/packages/shapes/src/utils/make-triangle.ts
index a892e8c4dd..31ec7a6830 100644
--- a/packages/shapes/src/utils/make-triangle.ts
+++ b/packages/shapes/src/utils/make-triangle.ts
@@ -37,7 +37,7 @@ export const makeTriangle = ({
const longerDimension = length;
const shorterSize = Math.sqrt(length ** 2 * 0.75); // Calculated on paper;
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
+
const points: {[key in Direction]: [number, number][]} = {
up: [
[longerDimension / 2, 0],