diff --git a/package-lock.json b/package-lock.json index 366bbe1c9..1d7e7d3f5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32,7 +32,7 @@ "eslint-plugin-react": "^7.37.5", "eslint-plugin-testing-library": "^7.5.3", "eslint-plugin-tsdoc": "^0.4.0", - "eslint-plugin-unicorn": "^59.0.1", + "eslint-plugin-unicorn": "^60.0.0", "fast-glob": "^3.3.3", "happy-dom": "18.0.1", "husky": "9.1.7", @@ -7028,6 +7028,13 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/change-case": { + "version": "5.4.4", + "resolved": "https://registry.npmjs.org/change-case/-/change-case-5.4.4.tgz", + "integrity": "sha512-HRQyTk2/YPEkt9TnUPbOpr64Uw3KOicFWPVBb+xiHvd6eBx/qPr9xqfBFDT8P2vWsvvz4jbEkfDe71W3VyNu2w==", + "dev": true, + "license": "MIT" + }, "node_modules/character-entities": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-2.0.2.tgz", @@ -9118,65 +9125,39 @@ } }, "node_modules/eslint-plugin-unicorn": { - "version": "59.0.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-59.0.1.tgz", - "integrity": "sha512-EtNXYuWPUmkgSU2E7Ttn57LbRREQesIP1BiLn7OZLKodopKfDXfBUkC/0j6mpw2JExwf43Uf3qLSvrSvppgy8Q==", + "version": "60.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-60.0.0.tgz", + "integrity": "sha512-QUzTefvP8stfSXsqKQ+vBQSEsXIlAiCduS/V1Em+FKgL9c21U/IIm20/e3MFy1jyCf14tHAhqC1sX8OTy6VUCg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-validator-identifier": "^7.25.9", - "@eslint-community/eslint-utils": "^4.5.1", - "@eslint/plugin-kit": "^0.2.7", - "ci-info": "^4.2.0", + "@babel/helper-validator-identifier": "^7.27.1", + "@eslint-community/eslint-utils": "^4.7.0", + "@eslint/plugin-kit": "^0.3.3", + "change-case": "^5.4.4", + "ci-info": "^4.3.0", "clean-regexp": "^1.0.0", - "core-js-compat": "^3.41.0", + "core-js-compat": "^3.44.0", "esquery": "^1.6.0", "find-up-simple": "^1.0.1", - "globals": "^16.0.0", + "globals": "^16.3.0", "indent-string": "^5.0.0", "is-builtin-module": "^5.0.0", "jsesc": "^3.1.0", "pluralize": "^8.0.0", "regexp-tree": "^0.1.27", "regjsparser": "^0.12.0", - "semver": "^7.7.1", + "semver": "^7.7.2", "strip-indent": "^4.0.0" }, "engines": { - "node": "^18.20.0 || ^20.10.0 || >=21.0.0" + "node": "^20.10.0 || >=21.0.0" }, "funding": { "url": "https://github.com/sindresorhus/eslint-plugin-unicorn?sponsor=1" }, "peerDependencies": { - "eslint": ">=9.22.0" - } - }, - "node_modules/eslint-plugin-unicorn/node_modules/@eslint/core": { - "version": "0.13.0", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.13.0.tgz", - "integrity": "sha512-yfkgDw1KR66rkT5A8ci4irzDysN7FRpq3ttJolR88OqQikAWqwA8j5VZyas+vjyBNFIJ7MfybJ9plMILI2UrCw==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@types/json-schema": "^7.0.15" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/eslint-plugin-unicorn/node_modules/@eslint/plugin-kit": { - "version": "0.2.8", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.8.tgz", - "integrity": "sha512-ZAoA40rNMPwSm+AeHpCq8STiNAwzWLJuP8Xv4CHIc9wv/PSuExjMrmjfYNj682vW0OOiZ1HKxzvjQr9XZIisQA==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@eslint/core": "^0.13.0", - "levn": "^0.4.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "eslint": ">=9.29.0" } }, "node_modules/eslint-plugin-unicorn/node_modules/globals": { diff --git a/package.json b/package.json index 14cb9da0d..bf2389e76 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "eslint-plugin-react": "^7.37.5", "eslint-plugin-testing-library": "^7.5.3", "eslint-plugin-tsdoc": "^0.4.0", - "eslint-plugin-unicorn": "^59.0.1", + "eslint-plugin-unicorn": "^60.0.0", "fast-glob": "^3.3.3", "happy-dom": "18.0.1", "husky": "9.1.7", diff --git a/packages/base/core/__tests__/Cursor.spec.ts b/packages/base/core/__tests__/Cursor.spec.ts index 974deb45a..8bd56ce40 100644 --- a/packages/base/core/__tests__/Cursor.spec.ts +++ b/packages/base/core/__tests__/Cursor.spec.ts @@ -50,7 +50,7 @@ describe('Cursor', () => { it('should return sorted items when sort option is provided', () => { const cursor = collection.find({}, { sort: { id: -1 } }) const result = cursor.fetch() - const expected = [...items].reverse() + const expected = [...items].toReversed() expect(result).toEqual(expected) }) diff --git a/packages/devtools/devtools/src/utils/useCollectionMeasuredTimes.ts b/packages/devtools/devtools/src/utils/useCollectionMeasuredTimes.ts index 1f3797383..43ca05fd0 100644 --- a/packages/devtools/devtools/src/utils/useCollectionMeasuredTimes.ts +++ b/packages/devtools/devtools/src/utils/useCollectionMeasuredTimes.ts @@ -13,7 +13,7 @@ export default function useCollectionMeasuredTimes(collectionName: string) { return measuredTimes.items .filter(q => q.collectionName === collectionName) .sort((a, b) => a.measuredTime - b.measuredTime) - .reverse() + .toReversed() .map(({ collectionName: _, time, ...item }) => ({ id: item.id, time: new Date(time as number), diff --git a/packages/devtools/devtools/src/utils/useCollectionMutations.ts b/packages/devtools/devtools/src/utils/useCollectionMutations.ts index 34c158026..8751c25b5 100644 --- a/packages/devtools/devtools/src/utils/useCollectionMutations.ts +++ b/packages/devtools/devtools/src/utils/useCollectionMutations.ts @@ -13,7 +13,7 @@ export default function useCollectionMutations(collectionName: string) { return mutations.items .filter(q => q.collectionName === collectionName) .sort((a, b) => a.time - b.time) - .reverse() + .toReversed() .map(({ collectionName: _, time, ...item }) => ({ id: item.id, time: new Date(time as number), diff --git a/packages/devtools/devtools/src/utils/useCollectionQueries.ts b/packages/devtools/devtools/src/utils/useCollectionQueries.ts index e7d897206..91c664525 100644 --- a/packages/devtools/devtools/src/utils/useCollectionQueries.ts +++ b/packages/devtools/devtools/src/utils/useCollectionQueries.ts @@ -13,7 +13,7 @@ export default function useCollectionQueries(collectionName: string) { return queries.items .filter(q => q.collectionName === collectionName) .sort((a, b) => a.time - b.time) - .reverse() + .toReversed() .map(({ collectionName: _, lastTime, ...item }) => ({ id: item.id, collectionName: item.collectionName,