Skip to content

🎥 Make videos programmatically with React

more

Jonny Burger5163b64078c0
diff --git a/packages/eslint-config/.eslintrc b/packages/eslint-config/.eslintrc
deleted file mode 100644
index 2f4fe588d1..0000000000
--- a/packages/eslint-config/.eslintrc
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "extends": "@remotion/internal",
-}
diff --git a/packages/eslint-config/eslint.config.mjs b/packages/eslint-config/eslint.config.mjs
new file mode 100644
index 0000000000..04fd4fac11
--- /dev/null
+++ b/packages/eslint-config/eslint.config.mjs
@@ -0,0 +1,7 @@
+import {remotionFlatConfig} from '@remotion/eslint-config-internal';
+
+const config = remotionFlatConfig({react: false});
+
+export default {
+ ...config,
+};
diff --git a/packages/studio-shared/.eslintrc b/packages/studio-shared/.eslintrc
deleted file mode 100644
index aa4f348725..0000000000
--- a/packages/studio-shared/.eslintrc
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "extends": "@remotion/internal",
- "rules": {
- "no-console": "error",
- "no-restricted-imports": [
- "error",
- {
- "patterns": ["@remotion/*/src/*", "remotion/src/*"],
- },
- ],
- "@typescript-eslint/no-use-before-define": "off",
- },
-}
diff --git a/packages/studio-shared/eslint.config.mjs b/packages/studio-shared/eslint.config.mjs
new file mode 100644
index 0000000000..404c9a0af4
--- /dev/null
+++ b/packages/studio-shared/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/studio-shared/src/package-info.ts b/packages/studio-shared/src/package-info.ts
index c7872dc239..58816c30b4 100644
--- a/packages/studio-shared/src/package-info.ts
+++ b/packages/studio-shared/src/package-info.ts
@@ -69,7 +69,7 @@ export const packages = [
export type Pkgs = (typeof packages)[number];
-// eslint-disable-next-line @typescript-eslint/no-unused-vars
+
export const descriptions: {[key in Pkgs]: string | null} = {
player: 'React component for embedding a Remotion preview into your app',
cloudrun: 'Render Remotion videos on Google Cloud Run',
@@ -142,7 +142,7 @@ export const descriptions: {[key in Pkgs]: string | null} = {
'eslint-config-internal': "ESLint condig for Remotion's internal packages",
};
-// eslint-disable-next-line @typescript-eslint/no-unused-vars
+
export const apiDocs: {[key in Pkgs]: string | null} = {
player: 'https://www.remotion.dev/docs/player',
cloudrun: 'https://www.remotion.dev/docs/cloudrun',
diff --git a/packages/studio-shared/src/stringify-default-props.ts b/packages/studio-shared/src/stringify-default-props.ts
index 2bbb14c02c..10efb8911c 100644
--- a/packages/studio-shared/src/stringify-default-props.ts
+++ b/packages/studio-shared/src/stringify-default-props.ts
@@ -2,6 +2,35 @@ import {NoReactInternals} from 'remotion/no-react';
export type EnumPath = (string | number)[];
+function replacerWithPath(
+ replacer: (
+ this: Record<string, unknown>,
+ field: string,
+ value: unknown,
+ path: (string | number)[],
+ ) => unknown,
+) {
+ const m = new Map();
+
+ return function (
+ this: Record<string, unknown>,
+ field: string,
+ value: unknown,
+ ) {
+ const path = [m.get(this), field].flat(1);
+ if (value === Object(value)) {
+ m.set(value, path);
+ }
+
+ return replacer.call(
+ this,
+ field,
+ value,
+ path.filter((item) => typeof item !== 'undefined' && item !== ''),
+ );
+ };
+}
+
const doesMatchPath = (path1: EnumPath, enumPaths: EnumPath[]) => {
return enumPaths.some((p) =>
path1.every((item, index) => {
@@ -64,32 +93,3 @@ export const stringifyDefaultProps = ({
.replace(/__WRAP_IN_DATE_START__/g, 'new Date("')
.replace(/__WRAP_IN_DATE_END__/g, '")');
};
-
-function replacerWithPath(
- replacer: (
- this: Record<string, unknown>,
- field: string,
- value: unknown,
- path: (string | number)[],
- ) => unknown,
-) {
- const m = new Map();
-
- return function (
- this: Record<string, unknown>,
- field: string,
- value: unknown,
- ) {
- const path = [m.get(this), field].flat(1);
- if (value === Object(value)) {
- m.set(value, path);
- }
-
- return replacer.call(
- this,
- field,
- value,
- path.filter((item) => typeof item !== 'undefined' && item !== ''),
- );
- };
-}