Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

fix: upgrade prettier #728

Merged
merged 1 commit into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: CI checks

on: [push]

jobs:
build-and-test:
runs-on: ubuntu-latest

steps:
- name: checkout
uses: actions/checkout@v3

- name: set up node
uses: actions/setup-node@v3

- name: Yarn Install and Cache
uses: graasp/graasp-deploy/.github/actions/yarn-install-and-cache@v1

- name: Check code linting
run: yarn check

- name: Build
run: yarn build
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
"arrowParens": "always",
"importOrder": ["^@mui", "^react", "^@?graasp", "^[./]"],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true
"importOrderSortSpecifiers": true,
"plugins": ["@trivago/prettier-plugin-sort-imports"]
}
10 changes: 4 additions & 6 deletions cypress/support/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -605,9 +605,8 @@ export const mockPostManyItemMemberships = (
return reply({ statusCode: StatusCodes.BAD_REQUEST });
}
const itemId = url.split('/')[4];
const itemMemberships = items.find(
({ id }) => id === itemId,
)?.memberships;
const itemMemberships = items.find(({ id }) => id === itemId)
?.memberships;

// return membership or error if membership
// for member id already exists
Expand Down Expand Up @@ -1459,9 +1458,8 @@ export const mockGetItemThumbnailUrl = (
const [link] = url.split('?');
const id = link.slice(API_HOST.length).split('/')[2];

const thumbnails = items.find(
({ id: thisId }) => id === thisId,
)?.thumbnails;
const thumbnails = items.find(({ id: thisId }) => id === thisId)
?.thumbnails;
if (!thumbnails) {
return reply({ statusCode: StatusCodes.NOT_FOUND });
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.4.3",
"@trivago/prettier-plugin-sort-imports": "4.1.1",
"@trivago/prettier-plugin-sort-imports": "4.2.0",
"@types/jest": "29.5.3",
"@types/lodash.partition": "4.6.7",
"@types/lodash.truncate": "4.4.7",
Expand Down Expand Up @@ -131,7 +131,7 @@
"husky": "8.0.3",
"istanbul-lib-coverage": "3.2.0",
"nyc": "15.1.0",
"prettier": "2.8.8",
"prettier": "3.0.1",
"react-app-rewired": "2.2.1",
"typescript": "5.1.6",
"wait-on": "7.0.1",
Expand Down
4 changes: 2 additions & 2 deletions src/components/item/ItemSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ export const useItemSearch = (
setSearchText(text.toLowerCase());
};

const results = items?.filter((it) =>
it?.name?.toLowerCase().includes(searchText),
const results = items?.filter(
(it) => it?.name?.toLowerCase().includes(searchText),
);

const itemSearchInput = (
Expand Down
4 changes: 2 additions & 2 deletions src/components/item/publish/DropdownMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ const DropdownMenu = ({
return null;
}

const selected = values.filter(({ id }) =>
selectedValues?.find(({ category }) => category.id === id),
const selected = values.filter(
({ id }) => selectedValues?.find(({ category }) => category.id === id),
);

return (
Expand Down
24 changes: 12 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6177,9 +6177,9 @@ __metadata:
languageName: node
linkType: hard

"@trivago/prettier-plugin-sort-imports@npm:4.1.1":
version: 4.1.1
resolution: "@trivago/prettier-plugin-sort-imports@npm:4.1.1"
"@trivago/prettier-plugin-sort-imports@npm:4.2.0":
version: 4.2.0
resolution: "@trivago/prettier-plugin-sort-imports@npm:4.2.0"
dependencies:
"@babel/generator": 7.17.7
"@babel/parser": ^7.20.5
Expand All @@ -6189,11 +6189,11 @@ __metadata:
lodash: ^4.17.21
peerDependencies:
"@vue/compiler-sfc": 3.x
prettier: 2.x
prettier: 2.x - 3.x
peerDependenciesMeta:
"@vue/compiler-sfc":
optional: true
checksum: 09b4c3c3f4a9e7883737acf92ae7f2a59eb3f7a6f104621a883bdb2a962dcf98398891489267a6fdbba1227a3484676f8d7470e1b3bc6422b4f457382fd030ce
checksum: 2081ba9f1a2d33b9a3eeadeb3e713d404ee3d1a5cff3b20a23d94d6d915f0a8ff549616c1e77cd728f1b33733e0d7ab8e4c2512f344a612d81ece40025351160
languageName: node
linkType: hard

Expand Down Expand Up @@ -12330,7 +12330,7 @@ __metadata:
"@testing-library/jest-dom": ^5.16.5
"@testing-library/react": ^14.0.0
"@testing-library/user-event": ^14.4.3
"@trivago/prettier-plugin-sort-imports": 4.1.1
"@trivago/prettier-plugin-sort-imports": 4.2.0
"@types/jest": 29.5.3
"@types/lodash.partition": 4.6.7
"@types/lodash.truncate": 4.4.7
Expand Down Expand Up @@ -12379,7 +12379,7 @@ __metadata:
lodash.truncate: 4.4.2
nyc: 15.1.0
papaparse: 5.4.1
prettier: 2.8.8
prettier: 3.0.1
prop-types: 15.8.1
qs: 6.11.2
react: ^17.0.2
Expand Down Expand Up @@ -17746,12 +17746,12 @@ __metadata:
languageName: node
linkType: hard

"prettier@npm:2.8.8":
version: 2.8.8
resolution: "prettier@npm:2.8.8"
"prettier@npm:3.0.1":
version: 3.0.1
resolution: "prettier@npm:3.0.1"
bin:
prettier: bin-prettier.js
checksum: b49e409431bf129dd89238d64299ba80717b57ff5a6d1c1a8b1a28b590d998a34e083fa13573bc732bb8d2305becb4c9a4407f8486c81fa7d55100eb08263cf8
prettier: bin/prettier.cjs
checksum: e1f3f16c7fe0495de3faa182597871f74927d787cce3c52095a66ff5d7eacc05173371d5f58bf12141a0a1b6bfe739a338531d6cf18b92c7256c1319f2c84e73
languageName: node
linkType: hard

Expand Down