Skip to content

Commit

Permalink
Merge pull request #4283 from serlo/chore/upgrade-prettier
Browse files Browse the repository at this point in the history
chore: upgrade prettier
  • Loading branch information
elbotho authored Nov 15, 2024
2 parents 01113bc + 827c6f6 commit 0c86dee
Show file tree
Hide file tree
Showing 30 changed files with 73 additions and 69 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
3 changes: 2 additions & 1 deletion apps/web/.prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"singleQuote": true,
"tailwindFunctions": ["cn"],
"trailingComma": "es5",
"plugins": ["prettier-plugin-tailwindcss", "prettier-plugin-packagejson"]
"plugins": ["prettier-plugin-tailwindcss", "prettier-plugin-packagejson"],
"tailwindPreserveWhitespace": true
}
6 changes: 3 additions & 3 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@
"postcss-flexbugs-fixes": "^5.0.2",
"postcss-import": "^16.1.0",
"postcss-nested": "^7.0.2",
"prettier": "^3.2.5",
"prettier-plugin-packagejson": "^2.5.0",
"prettier-plugin-tailwindcss": "^0.5.14",
"prettier": "^3.3.3",
"prettier-plugin-packagejson": "^2.5.3",
"prettier-plugin-tailwindcss": "^0.6.8",
"prop-types": "^15.8.1",
"slate": "^0.103.0",
"tailwindcss": "^3.4.15",
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/auth/login-button-bildungsraum.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function LoginButtonBildungsraum({
<hr />
<button
className={cn(`
mt-10 w-full items-center border border-transparent px-[22px] py-2 py-2 text-center
mt-10 w-full items-center border border-transparent px-[22px] py-2 text-center
text-lg font-bold shadow-menu transition-all hover:border-black focus-visible:border-black
sm:flex sm:text-left
`)}
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/auth/login-button-vidis.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function LoginButtonVidis({
<hr />
<button
className={cn(`
mt-10 w-full items-center border border-transparent px-[22px] py-2 py-2 text-center
mt-10 w-full items-center border border-transparent px-[22px] py-2 text-center
text-lg font-bold shadow-menu transition-all hover:border-black focus-visible:border-black
sm:flex sm:text-left
`)}
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/auth/node.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export function Node({
)}
>
<button
className="serlo-button-green mt-10 mt-10 block w-full py-2 text-xl"
className="serlo-button-green mt-10 block w-full py-2 text-xl"
name={attributes.name}
onClick={(e) => {
void onSubmit(e, (attributes as { value: string }).value)
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/comments/comment-area.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export function CommentArea({
highlightedCommentId !== undefined

const [showThreadChildren, setShowThreadChildren] = useState<string[]>(
showAll ? commentData.active?.map(({ id }) => id) ?? [] : []
showAll ? (commentData.active?.map(({ id }) => id) ?? []) : []
)

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,7 @@ export function DonationsBanner({ id, entityData }: DonationsBannerProps) {
<aside
ref={bannerRef}
className={cn(`
relative w-[100vw] overflow-x-hidden bg-[url("/_assets/img/landing/about-container.svg")]
bg-[url("/_assets/img/landing/about-container.svg")] bg-[length:100vw_100%] bg-bottom bg-no-repeat
relative w-[100vw] overflow-x-hidden bg-[url("/_assets/img/landing/about-container.svg")] bg-[length:100vw_100%] bg-bottom bg-no-repeat
px-side py-6 text-center
text-xl sm:-mx-2 sm:flex sm:max-w-[100vw] sm:justify-between
sm:px-0 sm:text-left lg:my-16 lg:py-10 lg:text-2xl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ export function TestimonialDonationsPage() {
<aside
className={cn(`
relative z-10 my-16 mt-20 mt-24
overflow-x-hidden bg-[url("/_assets/img/landing/about-container.svg")]
bg-[url("/_assets/img/landing/about-container.svg")] bg-[length:100vw_100%] bg-bottom bg-no-repeat
overflow-x-hidden bg-[url("/_assets/img/landing/about-container.svg")] bg-[length:100vw_100%] bg-bottom bg-no-repeat
pb-12 pb-14 pt-6 text-center text-2xl
sm:flex sm:justify-between sm:px-0 sm:text-left
`)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export function SubjectLandingTopicOverview({
const buttonClass = cn(
`
m-2 flex min-h-[4rem] w-auto
items-center rounded-xl p-2 text-left text-left font-bold
items-center rounded-xl p-2 text-left font-bold
text-brand shadow-menu transition-colors hover:bg-brand/5
`,
isActive ? 'bg-brand/10 text-black hover:bg-brand/10' : ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function MoreAuthorTools({
<UserToolsItem
title={
taxNewItems
? title ?? strings.editOrAdd.addNewEntities
? (title ?? strings.editOrAdd.addNewEntities)
: loggedInData.strings.tools
}
aboveContent={aboveContent}
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/components/user/events.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ function useEventsFetch(
actorUsername,
objectId,
instance,
first: oldest ? undefined : amount ?? 20,
last: oldest ? amount ?? 20 : undefined,
first: oldest ? undefined : (amount ?? 20),
last: oldest ? (amount ?? 20) : undefined,
},
config: {
refreshInterval: 10 * 60 * 1000, //10min
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/fetcher/request-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ export async function requestPage(

const fullTitle = page.title ? `${page.title}${uuid.title}` : uuid.title
const metaTitle =
fullTitle.length < 75 ? fullTitle : page.title ?? uuid.title
fullTitle.length < 75 ? fullTitle : (page.title ?? uuid.title)

const canonicalUrl = pageIndex ? coursePageUrls[pageIndex] : uuid.alias
const metaDescription = sharedMetadata.metaDescription?.length
Expand Down
12 changes: 6 additions & 6 deletions apps/web/src/fetcher/revision/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@ export async function requestRevision(
trashed: uuid.trashed,
title: Object.hasOwn(uuid, 'title') ? uuid.title : undefined,
metaTitle: Object.hasOwn(uuid, 'metaTitle')
? uuid.metaTitle ?? undefined
? (uuid.metaTitle ?? undefined)
: undefined,
metaDescription: Object.hasOwn(uuid, 'metaDescription')
? uuid.metaDescription ?? undefined
? (uuid.metaDescription ?? undefined)
: undefined,
content: thisExercise
? (thisExercise as unknown as EditorExerciseDocument)
: parseDocumentString(uuid.content),
url: Object.hasOwn(uuid, 'url') ? uuid.url ?? undefined : undefined,
url: Object.hasOwn(uuid, 'url') ? (uuid.url ?? undefined) : undefined,
},
currentRevision: {
id: uuid.repository.currentRevision?.id,
Expand All @@ -132,18 +132,18 @@ export async function requestRevision(
: undefined,
metaTitle:
currentRevision && Object.hasOwn(currentRevision, 'metaTitle')
? currentRevision.metaTitle ?? ''
? (currentRevision.metaTitle ?? '')
: undefined,
metaDescription:
currentRevision && Object.hasOwn(currentRevision, 'metaDescription')
? currentRevision.metaDescription ?? ''
? (currentRevision.metaDescription ?? '')
: undefined,
content: currentExercise
? (currentExercise as unknown as EditorExerciseDocument)
: parseDocumentString(uuid.repository.currentRevision?.content),
url:
currentRevision && Object.hasOwn(currentRevision, 'url')
? currentRevision.url ?? ''
? (currentRevision.url ?? '')
: undefined,
},
changes: Object.hasOwn(uuid, 'changes') ? uuid.changes : undefined,
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
"cross-env": "^7.0.3",
"dotenv-cli": "^7.4.2",
"postcss-import": "^16.1.0",
"prettier": "^3.2.5",
"prettier-plugin-packagejson": "^2.5.0"
"prettier": "^3.3.3",
"prettier-plugin-packagejson": "^2.5.3"
},
"packageManager": "[email protected]",
"engines": {
Expand Down
3 changes: 2 additions & 1 deletion packages/editor-web-component/.prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"singleQuote": true,
"tailwindFunctions": ["cn"],
"trailingComma": "es5",
"plugins": ["prettier-plugin-tailwindcss", "prettier-plugin-packagejson"]
"plugins": ["prettier-plugin-tailwindcss", "prettier-plugin-packagejson"],
"tailwindPreserveWhitespace": true
}
6 changes: 3 additions & 3 deletions packages/editor-web-component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@
"eslint-plugin-react-hooks": "^5.0.0",
"npm": "^10.9.0",
"npm-run-all": "^4.1.5",
"prettier": "^3.2.5",
"prettier-plugin-packagejson": "^2.5.0",
"prettier-plugin-tailwindcss": "^0.5.14",
"prettier": "^3.3.3",
"prettier-plugin-packagejson": "^2.5.3",
"prettier-plugin-tailwindcss": "^0.6.8",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"vite": "^5.4.11",
Expand Down
3 changes: 2 additions & 1 deletion packages/editor/.prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"singleQuote": true,
"tailwindFunctions": ["cn"],
"trailingComma": "es5",
"plugins": ["prettier-plugin-tailwindcss", "prettier-plugin-packagejson"]
"plugins": ["prettier-plugin-tailwindcss", "prettier-plugin-packagejson"],
"tailwindPreserveWhitespace": true
}
6 changes: 3 additions & 3 deletions packages/editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@
"postcss": "^8.4.49",
"postcss-flexbugs-fixes": "^5.0.2",
"postcss-import": "^16.1.0",
"prettier": "^3.2.5",
"prettier-plugin-packagejson": "^2.5.0",
"prettier-plugin-tailwindcss": "^0.5.14",
"prettier": "^3.3.3",
"prettier-plugin-packagejson": "^2.5.3",
"prettier-plugin-tailwindcss": "^0.6.8",
"ramda": "^0.30.1",
"rdndmb-html5-to-touch": "^8.0.3",
"react-dnd": "^16.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/editor/src/editor-ui/autogrow-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const AutogrowInput = forwardRef<
<span
className={cn(
'serlo-autogrow-input relative inline-grid',
'after:w-auto after:min-w-16 after:resize-none after:resize-none after:px-3 after:[grid-area:1_/_2]',
'after:w-auto after:min-w-16 after:resize-none after:px-3 after:[grid-area:1_/_2]',
"after:invisible after:-ml-2 after:whitespace-pre-wrap after:content-[attr(data-value)_'_']"
)}
data-value={String(value) + '_ '}
Expand Down
4 changes: 2 additions & 2 deletions packages/editor/src/plugins/serlo-table/editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,10 @@ export function SerloTableEditor(props: SerloTableProps) {
? rowIndex + 1 < rows.length
? rowIndex + 1
: rowIndex - 1
: focusedRowIndex ?? 0
: (focusedRowIndex ?? 0)

const colToFocusAfter = isRow
? focusedColIndex ?? 0
? (focusedColIndex ?? 0)
: colIndex + 1 < rows[0].columns.length
? colIndex + 1
: colIndex - 1
Expand Down
69 changes: 36 additions & 33 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5773,9 +5773,9 @@ __metadata:
eslint-plugin-react-hooks: ^5.0.0
npm: ^10.9.0
npm-run-all: ^4.1.5
prettier: ^3.2.5
prettier-plugin-packagejson: ^2.5.0
prettier-plugin-tailwindcss: ^0.5.14
prettier: ^3.3.3
prettier-plugin-packagejson: ^2.5.3
prettier-plugin-tailwindcss: ^0.6.8
react: ^18.2.0
react-dom: ^18.2.0
vite: ^5.4.11
Expand Down Expand Up @@ -5851,9 +5851,9 @@ __metadata:
postcss: ^8.4.49
postcss-flexbugs-fixes: ^5.0.2
postcss-import: ^16.1.0
prettier: ^3.2.5
prettier-plugin-packagejson: ^2.5.0
prettier-plugin-tailwindcss: ^0.5.14
prettier: ^3.3.3
prettier-plugin-packagejson: ^2.5.3
prettier-plugin-tailwindcss: ^0.6.8
ramda: ^0.30.1
rdndmb-html5-to-touch: ^8.0.3
react: ^18.2.0
Expand Down Expand Up @@ -5986,9 +5986,9 @@ __metadata:
postcss-flexbugs-fixes: ^5.0.2
postcss-import: ^16.1.0
postcss-nested: ^7.0.2
prettier: ^3.2.5
prettier-plugin-packagejson: ^2.5.0
prettier-plugin-tailwindcss: ^0.5.14
prettier: ^3.3.3
prettier-plugin-packagejson: ^2.5.3
prettier-plugin-tailwindcss: ^0.6.8
prop-types: ^15.8.1
qrcode.react: ^3.2.0
ramda: ^0.30.1
Expand Down Expand Up @@ -6036,8 +6036,8 @@ __metadata:
cross-env: ^7.0.3
dotenv-cli: ^7.4.2
postcss-import: ^16.1.0
prettier: ^3.2.5
prettier-plugin-packagejson: ^2.5.0
prettier: ^3.3.3
prettier-plugin-packagejson: ^2.5.3
languageName: unknown
linkType: soft

Expand Down Expand Up @@ -16005,24 +16005,24 @@ __metadata:
languageName: node
linkType: hard

"prettier-plugin-packagejson@npm:^2.5.0":
version: 2.5.0
resolution: "prettier-plugin-packagejson@npm:2.5.0"
"prettier-plugin-packagejson@npm:^2.5.3":
version: 2.5.3
resolution: "prettier-plugin-packagejson@npm:2.5.3"
dependencies:
sort-package-json: 2.10.0
synckit: 0.9.0
sort-package-json: 2.10.1
synckit: 0.9.2
peerDependencies:
prettier: ">= 1.16.0"
peerDependenciesMeta:
prettier:
optional: true
checksum: 0b05b02e96173abc1220d11a5ae6fbdefd45823ad86e5aba70bd52377f555db82fbe41c67bdfb186fa3f4c2ef5d12d4803b7215cb301533829a8389b411bb99a
checksum: 0b3063cb3d1be8e908fa2dcbee8601134f4aa847d41cdc7d3204b09a737b0c2b3606b2c531dfdbe4fc7ade9d21975528b9a56200f241c3450c461b9f046be3d7
languageName: node
linkType: hard

"prettier-plugin-tailwindcss@npm:^0.5.14":
version: 0.5.14
resolution: "prettier-plugin-tailwindcss@npm:0.5.14"
"prettier-plugin-tailwindcss@npm:^0.6.8":
version: 0.6.8
resolution: "prettier-plugin-tailwindcss@npm:0.6.8"
peerDependencies:
"@ianvs/prettier-plugin-sort-imports": "*"
"@prettier/plugin-pug": "*"
Expand All @@ -16035,6 +16035,7 @@ __metadata:
prettier-plugin-import-sort: "*"
prettier-plugin-jsdoc: "*"
prettier-plugin-marko: "*"
prettier-plugin-multiline-arrays: "*"
prettier-plugin-organize-attributes: "*"
prettier-plugin-organize-imports: "*"
prettier-plugin-sort-imports: "*"
Expand All @@ -16061,6 +16062,8 @@ __metadata:
optional: true
prettier-plugin-marko:
optional: true
prettier-plugin-multiline-arrays:
optional: true
prettier-plugin-organize-attributes:
optional: true
prettier-plugin-organize-imports:
Expand All @@ -16071,7 +16074,7 @@ __metadata:
optional: true
prettier-plugin-svelte:
optional: true
checksum: 205a774e53cdd9f8e61640ae3b778402758fad3d215fc57dd31172f12cf2b145095f5f973a431d495a6551b638bbb7e54c9f3a49848f0a0f755f5ad975b7c321
checksum: 03005038de54ac3f1d9e87505ec0e6c3f4e5ae31684b5964d6b85272b3fb1652d43b43866c3aab49c3a872601fea059a880bda7b36c08d0ad3530d6df10bfbbc
languageName: node
linkType: hard

Expand All @@ -16084,12 +16087,12 @@ __metadata:
languageName: node
linkType: hard

"prettier@npm:^3.2.5":
version: 3.2.5
resolution: "prettier@npm:3.2.5"
"prettier@npm:^3.3.3":
version: 3.3.3
resolution: "prettier@npm:3.3.3"
bin:
prettier: bin/prettier.cjs
checksum: 2ee4e1417572372afb7a13bb446b34f20f1bf1747db77cf6ccaf57a9be005f2f15c40f903d41a6b79eec3f57fff14d32a20fb6dee1f126da48908926fe43c311
checksum: bc8604354805acfdde6106852d14b045bb20827ad76a5ffc2455b71a8257f94de93f17f14e463fe844808d2ccc87248364a5691488a3304f1031326e62d9276e
languageName: node
linkType: hard

Expand Down Expand Up @@ -17763,9 +17766,9 @@ react-mathquill@Entkenntnis/tmp-react-mathquill:
languageName: node
linkType: hard

"sort-package-json@npm:2.10.0":
version: 2.10.0
resolution: "sort-package-json@npm:2.10.0"
"sort-package-json@npm:2.10.1":
version: 2.10.1
resolution: "sort-package-json@npm:2.10.1"
dependencies:
detect-indent: ^7.0.1
detect-newline: ^4.0.0
Expand All @@ -17777,7 +17780,7 @@ react-mathquill@Entkenntnis/tmp-react-mathquill:
sort-object-keys: ^1.1.3
bin:
sort-package-json: cli.js
checksum: 095e5c5075c9799d3d6174f82e963fa3be0a1d193af0be656b651d2e5b563dfc794f46c7aa74e3fc761de3fba76951ad2d3de716cf50b3aca4e938f63edbfcae
checksum: 861d8161565fba322414d70b6be10fb331680549b73399778965be628783833c85c4e02929bcea5a2d96994884b0327dfe2f7c7a79409c901d2582b703f5333d
languageName: node
linkType: hard

Expand Down Expand Up @@ -18312,13 +18315,13 @@ react-mathquill@Entkenntnis/tmp-react-mathquill:
languageName: node
linkType: hard

"synckit@npm:0.9.0":
version: 0.9.0
resolution: "synckit@npm:0.9.0"
"synckit@npm:0.9.2":
version: 0.9.2
resolution: "synckit@npm:0.9.2"
dependencies:
"@pkgr/core": ^0.1.0
tslib: ^2.6.2
checksum: c38bc3df0306c3242ddc5628d766ef0b4ca85a8a861b0a26b03483f09eca31a7fbdbcefb1b9fdee9e49db7739df25ce728cb2c6aef02ddc58bf46ee71924a36b
checksum: 3a30e828efbdcf3b50fccab4da6e90ea7ca24d8c5c2ad3ffe98e07d7c492df121e0f75227c6e510f96f976aae76f1fa4710cb7b1d69db881caf66ef9de89360e
languageName: node
linkType: hard

Expand Down

0 comments on commit 0c86dee

Please sign in to comment.