Skip to content

🎥 Make videos programmatically with React

fix warnings

Jonny Burgerf6b11dbbd8a9
diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json
index 87925e96c6..edc2f65cad 100644
--- a/packages/eslint-config/package.json
+++ b/packages/eslint-config/package.json
@@ -19,7 +19,7 @@
"@remotion/eslint-plugin": "2.6.14",
"@typescript-eslint/eslint-plugin": "5.11.0",
"@typescript-eslint/parser": "5.11.0",
- "eslint-plugin-10x": "1.5.0",
+ "eslint-plugin-10x": "1.5.1",
"eslint-plugin-react": "7.29.4",
"eslint-plugin-react-hooks": "4.4.0"
},
diff --git a/packages/lambda/src/api/__mocks__/create-function.ts b/packages/lambda/src/api/__mocks__/create-function.ts
index 9201f10440..2a6a618d3f 100644
--- a/packages/lambda/src/api/__mocks__/create-function.ts
+++ b/packages/lambda/src/api/__mocks__/create-function.ts
@@ -6,7 +6,7 @@ import {
import {createFunction as original} from '../create-function';
import {addFunction} from '../mock-functions';
-export const createFunction: typeof original = async (input) => {
+export const createFunction: typeof original = (input) => {
if (!input.alreadyCreated) {
addFunction(
{
diff --git a/packages/lambda/src/api/get-render-progress.ts b/packages/lambda/src/api/get-render-progress.ts
index 84c49a2730..cfa737c670 100644
--- a/packages/lambda/src/api/get-render-progress.ts
+++ b/packages/lambda/src/api/get-render-progress.ts
@@ -24,7 +24,7 @@ export const getRenderProgress = async ({
renderId,
region,
}: GetRenderInput): Promise<RenderProgress> => {
- return callLambda({
+ const result = await callLambda({
functionName,
type: LambdaRoutines.status,
payload: {
@@ -33,4 +33,5 @@ export const getRenderProgress = async ({
},
region,
});
+ return result;
};
diff --git a/packages/lambda/src/cli/helpers/yes-or-no.ts b/packages/lambda/src/cli/helpers/yes-or-no.ts
index 6a5ebe37b5..ca88ec8bcb 100644
--- a/packages/lambda/src/cli/helpers/yes-or-no.ts
+++ b/packages/lambda/src/cli/helpers/yes-or-no.ts
@@ -18,13 +18,13 @@ function defaultInvalidHandler({
process.stdout.write('Or no: (' + noValues.join(', ') + ') \n\n');
}
-export const yesOrNo = async ({
+export const yesOrNo = ({
question,
defaultValue,
}: {
question: string;
defaultValue: boolean;
-}) => {
+}): Promise<boolean> => {
const invalid = defaultInvalidHandler;
const yesValues = options.yes.map((v) => v.toLowerCase());
diff --git a/packages/lambda/src/functions/helpers/__mocks__/get-chromium-executable-path.ts b/packages/lambda/src/functions/helpers/__mocks__/get-chromium-executable-path.ts
index e9eeca2422..53a5c5479b 100644
--- a/packages/lambda/src/functions/helpers/__mocks__/get-chromium-executable-path.ts
+++ b/packages/lambda/src/functions/helpers/__mocks__/get-chromium-executable-path.ts
@@ -1,5 +1,5 @@
import {executablePath as original} from '../../../functions/helpers/get-chromium-executable-path';
-export const executablePath: typeof original = async () => {
+export const executablePath: typeof original = () => {
return undefined;
};
diff --git a/packages/lambda/src/functions/helpers/__mocks__/io.ts b/packages/lambda/src/functions/helpers/__mocks__/io.ts
index 4c7a6e0487..8b33222bad 100644
--- a/packages/lambda/src/functions/helpers/__mocks__/io.ts
+++ b/packages/lambda/src/functions/helpers/__mocks__/io.ts
@@ -46,7 +46,7 @@ export const lambdaWriteFile: typeof writeOriginal = ({
return Promise.resolve(undefined);
};
-export const lambdaLs: typeof lsOriginal = async (
+export const lambdaLs: typeof lsOriginal = (
input: LambdaLSInput
): LambdaLsReturnType => {
if (!input) {
@@ -58,17 +58,19 @@ export const lambdaLs: typeof lsOriginal = async (
region: input.region,
});
- return files
- .filter((p) => p.key.startsWith(input.prefix))
- .map((file): _Object => {
- const size = typeof file.content === 'string' ? file.content.length : 0;
- return {
- Key: file.key,
- ETag: undefined,
- LastModified: new Date(0),
- Owner: undefined,
- Size: size,
- StorageClass: undefined,
- };
- });
+ return Promise.resolve(
+ files
+ .filter((p) => p.key.startsWith(input.prefix))
+ .map((file): _Object => {
+ const size = typeof file.content === 'string' ? file.content.length : 0;
+ return {
+ Key: file.key,
+ ETag: undefined,
+ LastModified: new Date(0),
+ Owner: undefined,
+ Size: size,
+ StorageClass: undefined,
+ };
+ })
+ );
};
diff --git a/packages/lambda/src/functions/helpers/concat-videos.ts b/packages/lambda/src/functions/helpers/concat-videos.ts
index 1acfbf220e..3b51e1b320 100644
--- a/packages/lambda/src/functions/helpers/concat-videos.ts
+++ b/packages/lambda/src/functions/helpers/concat-videos.ts
@@ -60,7 +60,7 @@ const downloadS3File = async ({
});
};
-const getAllFilesS3 = async ({
+const getAllFilesS3 = ({
bucket,
expectedFiles,
outdir,
diff --git a/packages/lambda/src/functions/info.ts b/packages/lambda/src/functions/info.ts
index 3edf944081..6cb25ae3a2 100644
--- a/packages/lambda/src/functions/info.ts
+++ b/packages/lambda/src/functions/info.ts
@@ -5,7 +5,7 @@ import {
LambdaVersions,
} from '../shared/constants';
-export const infoHandler = async (lambdaParams: LambdaPayload) => {
+export const infoHandler = (lambdaParams: LambdaPayload) => {
if (lambdaParams.type !== LambdaRoutines.info) {
throw new TypeError('Expected info type');
}
diff --git a/packages/lambda/src/functions/progress.ts b/packages/lambda/src/functions/progress.ts
index 5c9bd2087f..5b53b21aed 100644
--- a/packages/lambda/src/functions/progress.ts
+++ b/packages/lambda/src/functions/progress.ts
@@ -11,7 +11,7 @@ type Options = {
timeoutInMiliseconds: number;
};
-export const progressHandler = async (
+export const progressHandler = (
lambdaParams: LambdaPayload,
options: Options
): Promise<RenderProgress> => {
diff --git a/packages/lambda/src/test/integration/deploy-site.test.ts b/packages/lambda/src/test/integration/deploy-site.test.ts
index b9f7e98146..ee93f9d10d 100644
--- a/packages/lambda/src/test/integration/deploy-site.test.ts
+++ b/packages/lambda/src/test/integration/deploy-site.test.ts
@@ -13,7 +13,7 @@ test('Should throw on wrong prefix', async () => {
).rejects.toThrow(/The bucketName parameter must start /);
});
-test('Should throw if invalid region was passed', async () => {
+test('Should throw if invalid region was passed', () => {
expect(() =>
deploySite({
bucketName: 'remotionlambda-testing',
@@ -25,7 +25,7 @@ test('Should throw if invalid region was passed', async () => {
).rejects.toThrow(/ap-northeast-9 is not a valid AWS region/);
});
-test("Should throw if bucket doesn't exist", async () => {
+test("Should throw if bucket doesn't exist", () => {
expect(() =>
deploySite({
bucketName: 'remotionlambda-non-existed',
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 0942f1050b..b463320fc4 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -334,7 +334,7 @@ importers:
'@types/node': 17.0.17
'@typescript-eslint/eslint-plugin': 5.11.0
'@typescript-eslint/parser': 5.11.0
- eslint-plugin-10x: 1.5.0
+ eslint-plugin-10x: 1.5.1
eslint-plugin-react: 7.29.4
eslint-plugin-react-hooks: 4.4.0
typescript: ^4.5.5
@@ -342,7 +342,7 @@ importers:
'@remotion/eslint-plugin': link:../eslint-plugin
'@typescript-eslint/eslint-plugin': 5.11.0_5448361d0c7d01128df3422f1139058a
'@typescript-eslint/parser': [email protected]
- eslint-plugin-10x: 1.5.0
+ eslint-plugin-10x: 1.5.1
eslint-plugin-react: 7.29.4
eslint-plugin-react-hooks: 4.4.0
devDependencies:
@@ -14529,21 +14529,21 @@ packages:
pkg-dir: 2.0.0
dev: false
- /eslint-plugin-10x/1.5.0:
+ /eslint-plugin-10x/[email protected]:
resolution: {integrity: sha512-MZn5wgGgzBwE7SYnrwAhq1vb/vlt/Jw+ycezFr5x/BW1Kn7Uoe3WzKt5T4OITFVS6//BprMTT+79mYQvjlfWTQ==}
peerDependencies:
eslint: ^7.8.0
dependencies:
+ eslint: 8.13.0
jsx-ast-utils: 2.4.1
- dev: false
- /eslint-plugin-10x/[email protected]:
- resolution: {integrity: sha512-MZn5wgGgzBwE7SYnrwAhq1vb/vlt/Jw+ycezFr5x/BW1Kn7Uoe3WzKt5T4OITFVS6//BprMTT+79mYQvjlfWTQ==}
+ /eslint-plugin-10x/1.5.1:
+ resolution: {integrity: sha512-dpphiMfRuNWHSelDUo0NRRczt+9qBQJxSEXvnw/YQjfHirJ7mHkpP1g0x/Q/hmUYh865dly1Yytx2Ulp+btyvQ==}
peerDependencies:
- eslint: ^7.8.0
+ eslint: '>=7.8.0'
dependencies:
- eslint: 8.13.0
jsx-ast-utils: 2.4.1
+ dev: false
/eslint-plugin-flowtype/[email protected]:
resolution: {integrity: sha512-vcz32f+7TP+kvTUyMXZmCnNujBQZDNmcqPImw8b9PZ+16w1Qdm6ryRuYZYVaG9xRqqmAPr2Cs9FAX5gN+x/bjw==}