diff --git a/cli/.eslintrc.cjs b/cli/.eslintrc.cjs index 18a48ac7e1..fe8044df81 100644 --- a/cli/.eslintrc.cjs +++ b/cli/.eslintrc.cjs @@ -21,6 +21,7 @@ module.exports = { 'unicorn/prefer-module': 'off', 'unicorn/prevent-abbreviations': 'off', 'unicorn/no-process-exit': 'off', + 'unicorn/import-style': 'off', curly: 2, 'prettier/prettier': 0, }, diff --git a/cli/package-lock.json b/cli/package-lock.json index 563cf7cd5f..fbb4ecb154 100644 --- a/cli/package-lock.json +++ b/cli/package-lock.json @@ -30,7 +30,7 @@ "eslint": "^8.56.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-prettier": "^5.1.3", - "eslint-plugin-unicorn": "^51.0.0", + "eslint-plugin-unicorn": "^52.0.0", "glob": "^10.3.1", "mock-fs": "^5.2.0", "prettier": "^3.2.5", @@ -2194,9 +2194,9 @@ } }, "node_modules/eslint-plugin-unicorn": { - "version": "51.0.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-51.0.1.tgz", - "integrity": "sha512-MuR/+9VuB0fydoI0nIn2RDA5WISRn4AsJyNSaNKLVwie9/ONvQhxOBbkfSICBPnzKrB77Fh6CZZXjgTt/4Latw==", + "version": "52.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-52.0.0.tgz", + "integrity": "sha512-1Yzm7/m+0R4djH0tjDjfVei/ju2w3AzUGjG6q8JnuNIL5xIwsflyCooW5sfBvQp2pMYQFSWWCFONsjCax1EHng==", "dev": true, "dependencies": { "@babel/helper-validator-identifier": "^7.22.20", diff --git a/cli/package.json b/cli/package.json index d33de8918e..97d1cfd3ef 100644 --- a/cli/package.json +++ b/cli/package.json @@ -28,7 +28,7 @@ "eslint": "^8.56.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-prettier": "^5.1.3", - "eslint-plugin-unicorn": "^51.0.0", + "eslint-plugin-unicorn": "^52.0.0", "glob": "^10.3.1", "mock-fs": "^5.2.0", "prettier": "^3.2.5", diff --git a/e2e/.eslintrc.cjs b/e2e/.eslintrc.cjs index 3989e86e54..3594073202 100644 --- a/e2e/.eslintrc.cjs +++ b/e2e/.eslintrc.cjs @@ -19,6 +19,7 @@ module.exports = { '@typescript-eslint/no-explicit-any': 'off', '@typescript-eslint/no-floating-promises': 'error', 'unicorn/prefer-module': 'off', + 'unicorn/import-style': 'off', curly: 2, 'prettier/prettier': 0, 'unicorn/prevent-abbreviations': 'off', diff --git a/e2e/package-lock.json b/e2e/package-lock.json index 333c181d91..b011c4bb1c 100644 --- a/e2e/package-lock.json +++ b/e2e/package-lock.json @@ -23,7 +23,7 @@ "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-prettier": "^5.1.3", - "eslint-plugin-unicorn": "^51.0.1", + "eslint-plugin-unicorn": "^52.0.0", "exiftool-vendored": "^24.5.0", "luxon": "^3.4.4", "pg": "^8.11.3", @@ -63,7 +63,7 @@ "eslint": "^8.56.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-prettier": "^5.1.3", - "eslint-plugin-unicorn": "^51.0.0", + "eslint-plugin-unicorn": "^52.0.0", "glob": "^10.3.1", "mock-fs": "^5.2.0", "prettier": "^3.2.5", @@ -2343,9 +2343,9 @@ } }, "node_modules/eslint-plugin-unicorn": { - "version": "51.0.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-51.0.1.tgz", - "integrity": "sha512-MuR/+9VuB0fydoI0nIn2RDA5WISRn4AsJyNSaNKLVwie9/ONvQhxOBbkfSICBPnzKrB77Fh6CZZXjgTt/4Latw==", + "version": "52.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-52.0.0.tgz", + "integrity": "sha512-1Yzm7/m+0R4djH0tjDjfVei/ju2w3AzUGjG6q8JnuNIL5xIwsflyCooW5sfBvQp2pMYQFSWWCFONsjCax1EHng==", "dev": true, "dependencies": { "@babel/helper-validator-identifier": "^7.22.20", diff --git a/e2e/package.json b/e2e/package.json index 45f72217cb..171b803b70 100644 --- a/e2e/package.json +++ b/e2e/package.json @@ -33,7 +33,7 @@ "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-prettier": "^5.1.3", - "eslint-plugin-unicorn": "^51.0.1", + "eslint-plugin-unicorn": "^52.0.0", "exiftool-vendored": "^24.5.0", "luxon": "^3.4.4", "pg": "^8.11.3", diff --git a/e2e/src/api/specs/activity.e2e-spec.ts b/e2e/src/api/specs/activity.e2e-spec.ts index 5d3cf72209..d3d7db6972 100644 --- a/e2e/src/api/specs/activity.e2e-spec.ts +++ b/e2e/src/api/specs/activity.e2e-spec.ts @@ -148,7 +148,7 @@ describe('/activity', () => { }); it('should filter by userId', async () => { - const [reaction] = await Promise.all([createActivity({ albumId: album.id, type: ReactionType.Like })]); + const reaction = await createActivity({ albumId: album.id, type: ReactionType.Like }); const response1 = await request(app) .get('/activity') @@ -250,8 +250,7 @@ describe('/activity', () => { }); it('should return a 200 for a duplicate like on the album', async () => { - const [reaction] = await Promise.all([createActivity({ albumId: album.id, type: ReactionType.Like })]); - + const reaction = await createActivity({ albumId: album.id, type: ReactionType.Like }); const { status, body } = await request(app) .post('/activity') .set('Authorization', `Bearer ${admin.accessToken}`) @@ -261,13 +260,11 @@ describe('/activity', () => { }); it('should not confuse an album like with an asset like', async () => { - const [reaction] = await Promise.all([ - createActivity({ - albumId: album.id, - assetId: asset.id, - type: ReactionType.Like, - }), - ]); + const reaction = await createActivity({ + albumId: album.id, + assetId: asset.id, + type: ReactionType.Like, + }); const { status, body } = await request(app) .post('/activity') .set('Authorization', `Bearer ${admin.accessToken}`) @@ -314,13 +311,11 @@ describe('/activity', () => { }); it('should return a 200 for a duplicate like on an asset', async () => { - const [reaction] = await Promise.all([ - createActivity({ - albumId: album.id, - assetId: asset.id, - type: ReactionType.Like, - }), - ]); + const reaction = await createActivity({ + albumId: album.id, + assetId: asset.id, + type: ReactionType.Like, + }); const { status, body } = await request(app) .post('/activity') diff --git a/e2e/src/api/specs/asset.e2e-spec.ts b/e2e/src/api/specs/asset.e2e-spec.ts index ddc8dd3ef6..40de8faef5 100644 --- a/e2e/src/api/specs/asset.e2e-spec.ts +++ b/e2e/src/api/specs/asset.e2e-spec.ts @@ -111,7 +111,7 @@ describe('/asset', () => { utils.createAsset(user1.accessToken), ]); - user2Assets = await Promise.all([utils.createAsset(user2.accessToken)]); + user2Assets = [await utils.createAsset(user2.accessToken)]; await Promise.all([ utils.createAsset(timeBucketUser.accessToken, { fileCreatedAt: new Date('1970-01-01').toISOString() }), diff --git a/e2e/src/setup.ts b/e2e/src/setup.ts index a3d96ac17f..e9395ddd35 100644 --- a/e2e/src/setup.ts +++ b/e2e/src/setup.ts @@ -1,7 +1,7 @@ import { exec, spawn } from 'node:child_process'; import { setTimeout } from 'node:timers'; -export default async () => { +const setup = async () => { let _resolve: () => unknown; let _reject: (error: Error) => unknown; @@ -31,3 +31,5 @@ export default async () => { await new Promise((resolve) => exec('docker compose down', () => resolve())); }; }; + +export default setup; diff --git a/server/.eslintrc.js b/server/.eslintrc.js index 75138ff235..0339cfb4c5 100644 --- a/server/.eslintrc.js +++ b/server/.eslintrc.js @@ -25,6 +25,7 @@ module.exports = { 'unicorn/prefer-top-level-await': 'off', 'unicorn/prefer-event-target': 'off', 'unicorn/no-thenable': 'off', + 'unicorn/import-style': 'off', '@typescript-eslint/await-thenable': 'error', '@typescript-eslint/no-floating-promises': 'error', '@typescript-eslint/no-misused-promises': 'error', diff --git a/server/package-lock.json b/server/package-lock.json index ea6f760a9a..3ce99e02fd 100644 --- a/server/package-lock.json +++ b/server/package-lock.json @@ -88,7 +88,7 @@ "eslint": "^8.56.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-prettier": "^5.1.3", - "eslint-plugin-unicorn": "^51.0.0", + "eslint-plugin-unicorn": "^52.0.0", "jest": "^29.6.4", "jest-when": "^3.6.0", "mock-fs": "^5.2.0", @@ -7493,9 +7493,9 @@ } }, "node_modules/eslint-plugin-unicorn": { - "version": "51.0.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-51.0.1.tgz", - "integrity": "sha512-MuR/+9VuB0fydoI0nIn2RDA5WISRn4AsJyNSaNKLVwie9/ONvQhxOBbkfSICBPnzKrB77Fh6CZZXjgTt/4Latw==", + "version": "52.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-52.0.0.tgz", + "integrity": "sha512-1Yzm7/m+0R4djH0tjDjfVei/ju2w3AzUGjG6q8JnuNIL5xIwsflyCooW5sfBvQp2pMYQFSWWCFONsjCax1EHng==", "dev": true, "dependencies": { "@babel/helper-validator-identifier": "^7.22.20", @@ -19876,9 +19876,9 @@ } }, "eslint-plugin-unicorn": { - "version": "51.0.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-51.0.1.tgz", - "integrity": "sha512-MuR/+9VuB0fydoI0nIn2RDA5WISRn4AsJyNSaNKLVwie9/ONvQhxOBbkfSICBPnzKrB77Fh6CZZXjgTt/4Latw==", + "version": "52.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-52.0.0.tgz", + "integrity": "sha512-1Yzm7/m+0R4djH0tjDjfVei/ju2w3AzUGjG6q8JnuNIL5xIwsflyCooW5sfBvQp2pMYQFSWWCFONsjCax1EHng==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.22.20", diff --git a/server/package.json b/server/package.json index 778ca705de..2b2a6f425d 100644 --- a/server/package.json +++ b/server/package.json @@ -112,7 +112,7 @@ "eslint": "^8.56.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-prettier": "^5.1.3", - "eslint-plugin-unicorn": "^51.0.0", + "eslint-plugin-unicorn": "^52.0.0", "jest": "^29.6.4", "jest-when": "^3.6.0", "mock-fs": "^5.2.0", diff --git a/web/.eslintrc.cjs b/web/.eslintrc.cjs index 535765f115..e29c4a9b48 100644 --- a/web/.eslintrc.cjs +++ b/web/.eslintrc.cjs @@ -50,6 +50,7 @@ module.exports = { 'unicorn/no-nested-ternary': 'off', 'unicorn/consistent-function-scoping': 'off', 'unicorn/prefer-top-level-await': 'off', + 'unicorn/import-style': 'off', // TODO: set recommended-type-checked and remove these rules '@typescript-eslint/await-thenable': 'error', '@typescript-eslint/no-floating-promises': 'error', diff --git a/web/package-lock.json b/web/package-lock.json index a400311100..6b009945cc 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -45,7 +45,7 @@ "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-svelte": "^2.35.1", - "eslint-plugin-unicorn": "^51.0.1", + "eslint-plugin-unicorn": "^52.0.0", "factory.ts": "^1.4.1", "postcss": "^8.4.35", "prettier": "^3.2.5", @@ -4167,9 +4167,9 @@ "dev": true }, "node_modules/eslint-plugin-unicorn": { - "version": "51.0.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-51.0.1.tgz", - "integrity": "sha512-MuR/+9VuB0fydoI0nIn2RDA5WISRn4AsJyNSaNKLVwie9/ONvQhxOBbkfSICBPnzKrB77Fh6CZZXjgTt/4Latw==", + "version": "52.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-52.0.0.tgz", + "integrity": "sha512-1Yzm7/m+0R4djH0tjDjfVei/ju2w3AzUGjG6q8JnuNIL5xIwsflyCooW5sfBvQp2pMYQFSWWCFONsjCax1EHng==", "dev": true, "dependencies": { "@babel/helper-validator-identifier": "^7.22.20", diff --git a/web/package.json b/web/package.json index 58bb670fcf..f220b44083 100644 --- a/web/package.json +++ b/web/package.json @@ -41,7 +41,7 @@ "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-svelte": "^2.35.1", - "eslint-plugin-unicorn": "^51.0.1", + "eslint-plugin-unicorn": "^52.0.0", "factory.ts": "^1.4.1", "postcss": "^8.4.35", "prettier": "^3.2.5",