From e54385baf90b5b2e405ecf3d91a7652fb6028284 Mon Sep 17 00:00:00 2001 From: Adam Antal Date: Sat, 28 Dec 2024 12:25:14 +0100 Subject: [PATCH] Update prettier & stylelint-prettier packages to latest + configuration so that it all pays together (exlint + prettier) --- .stylelintrc | 6 +++++- package.json | 4 ++-- .../modal/reservation-details/helper.ts | 2 +- src/components/material/MaterialHeader.tsx | 4 ++-- .../utils/useReservableFromAnotherLibrary.tsx | 5 ++--- yarn.lock | 16 ++++++++-------- 6 files changed, 20 insertions(+), 17 deletions(-) diff --git a/.stylelintrc b/.stylelintrc index 4eae7b15d0..d5c3e264c2 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -1,5 +1,9 @@ { - "extends": ["stylelint-config-recommended-scss", "stylelint-prettier/recommended"], + "extends": [ + "stylelint-config-recommended-scss", + "stylelint-prettier/recommended", + "prettier" + ], "plugins": ["@namics/stylelint-bem"], "rules": { "plugin/stylelint-bem-namics": { diff --git a/package.json b/package.json index eb17253dc9..4a713d6a09 100644 --- a/package.json +++ b/package.json @@ -120,7 +120,7 @@ "postcss-cli": "^11.0.0", "postcss-loader": "^8.1.1", "postcss-scss": "^4.0.9", - "prettier": "3.0.0", + "prettier": "3.4.2", "replace-in-file": "^6.3.2", "sass": "^1.83.0", "source-map-support": "^0.5.21", @@ -129,7 +129,7 @@ "stylelint": "^15.11.0", "stylelint-config-prettier": "^9.0.5", "stylelint-config-recommended-scss": "^6.0.0", - "stylelint-prettier": "4.0.0", + "stylelint-prettier": "5.0.2", "stylelint-scss": "^6.10.0", "stylelint-webpack-plugin": "^5.0.1", "svg-url-loader": "^8.0.0", diff --git a/src/apps/reservation-list/modal/reservation-details/helper.ts b/src/apps/reservation-list/modal/reservation-details/helper.ts index 6f8a52f171..93d95f1bb2 100644 --- a/src/apps/reservation-list/modal/reservation-details/helper.ts +++ b/src/apps/reservation-list/modal/reservation-details/helper.ts @@ -46,7 +46,7 @@ export const getReservationsForSaving = ({ selectedBranch: string; }) => { const getSelectedExpiryDate = (value: FormSelectValue) => - typeof value === "number" ? getFutureDateString(value) : expiryDate ?? ""; + typeof value === "number" ? getFutureDateString(value) : (expiryDate ?? ""); const getSelectedPickupBranch = (value: FormSelectValue) => typeof value === "string" ? value : selectedBranch; diff --git a/src/components/material/MaterialHeader.tsx b/src/components/material/MaterialHeader.tsx index ad8d8c5566..2ba7af1f0b 100644 --- a/src/components/material/MaterialHeader.tsx +++ b/src/components/material/MaterialHeader.tsx @@ -74,8 +74,8 @@ const MaterialHeader: React.FC = ({ ); }; const author = creatorsToString(flattenCreators(creators), t); - const containsDanish = mainLanguages.some( - (language) => language?.isoCode.toLowerCase().includes("dan") + const containsDanish = mainLanguages.some((language) => + language?.isoCode.toLowerCase().includes("dan") ); const allLanguages = mainLanguages .map((language) => language.display) diff --git a/src/core/utils/useReservableFromAnotherLibrary.tsx b/src/core/utils/useReservableFromAnotherLibrary.tsx index fc9d19004c..9f40c4182c 100644 --- a/src/core/utils/useReservableFromAnotherLibrary.tsx +++ b/src/core/utils/useReservableFromAnotherLibrary.tsx @@ -27,9 +27,8 @@ const useReservableFromAnotherLibrary = ( } const reservablePidsFromAnotherLibrary = manifestations - .filter( - ({ catalogueCodes }) => - catalogueCodes?.otherCatalogues.some((code) => code.startsWith("OVE")) + .filter(({ catalogueCodes }) => + catalogueCodes?.otherCatalogues.some((code) => code.startsWith("OVE")) ) .map(({ pid }) => pid); diff --git a/yarn.lock b/yarn.lock index 4847182bd7..51a436acba 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10871,10 +10871,10 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.0.tgz#e7b19f691245a21d618c68bc54dc06122f6105ae" - integrity sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g== +prettier@3.4.2: + version "3.4.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.4.2.tgz#a5ce1fb522a588bf2b78ca44c6e6fe5aa5a2b13f" + integrity sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ== pretty-bytes@^5.6.0: version "5.6.0" @@ -12508,10 +12508,10 @@ stylelint-config-recommended@^7.0.0: resolved "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-7.0.0.tgz" integrity sha512-yGn84Bf/q41J4luis1AZ95gj0EQwRX8lWmGmBwkwBNSkpGSpl66XcPTulxGa/Z91aPoNGuIGBmFkcM1MejMo9Q== -stylelint-prettier@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/stylelint-prettier/-/stylelint-prettier-4.0.0.tgz#e04f33bf9968a5d5478d2d11b20bdc5a7de2dc35" - integrity sha512-hYlObunQiSzc5XRttNiDyaY1W7ytW/AJtEbaDxy0rr4ioQvko+cjAgSGrRbz0iRB+yc6jiMrUmHcGkvFb+zDqw== +stylelint-prettier@5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/stylelint-prettier/-/stylelint-prettier-5.0.2.tgz#82c0a813d8981fe094fca28126fc88cee22fa789" + integrity sha512-qJ+BN+1T2ZcKz9WIrv0x+eFGHzSUnXfXd5gL///T6XoJvr3D8/ztzz2fhtmXef7Vb8P33zBXmLTTveByr0nwBw== dependencies: prettier-linter-helpers "^1.0.0"