Skip to content

Commit

Permalink
fix prettier setup
Browse files Browse the repository at this point in the history
  • Loading branch information
elbotho committed Dec 5, 2023
1 parent 427f57e commit 76d8c42
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/repo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ jobs:
with:
node-version: 18.x
- run: yarn
- run: yarn global:prettier
- run: yarn :prettier
4 changes: 0 additions & 4 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# this also checks .gitignore

# let packages and apps handle pretter themselves for now
apps
packages

# Yarn
.yarn
yarn.lock
3 changes: 2 additions & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"semi": false,
"singleQuote": true,
"trailingComma": "es5"
"trailingComma": "es5",
"plugins": ["prettier-plugin-packagejson"]
}
4 changes: 2 additions & 2 deletions apps/web/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"semi": false,
"singleQuote": true,
"plugins": ["prettier-plugin-tailwindcss"],
"tailwindFunctions": ["cn"],
"trailingComma": "es5"
"trailingComma": "es5",
"plugins": ["prettier-plugin-tailwindcss", "prettier-plugin-packagejson"]
}
6 changes: 3 additions & 3 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,15 @@
"minimumChangeThreshold": 0,
"showDetails": true
},
"svgr": {
"svgo": false
},
"postcss": {
"plugins": {
"tailwindcss/nesting": {},
"tailwindcss": {},
"postcss-flexbugs-fixes": {},
"autoprefixer": {}
}
},
"svgr": {
"svgo": false
}
}
10 changes: 5 additions & 5 deletions apps/web/src/helper/feature-i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export function getInstanceDataByLang(lang: Instance) {
? hiInstanceData
: enInstanceData

return mergeDeepRight(enData, data) as typeof enInstanceData
return mergeDeepRight(enData, data)
}

export function getServerSideStrings(lang: string) {
Expand All @@ -92,7 +92,7 @@ export function getServerSideStrings(lang: string) {
? hiServerSideStrings
: enServerSideStrings

return mergeDeepRight(enData, data) as typeof enServerSideStrings
return mergeDeepRight(enData, data)
}

export function getLandingData(lang: string) {
Expand All @@ -111,7 +111,7 @@ export function getLandingData(lang: string) {
? hiInstanceLandingData
: enInstanceLandingData

return mergeDeepRight(enData, data) as typeof enInstanceLandingData
return mergeDeepRight(enData, data)
}

export function getLoggedInData(lang: string) {
Expand All @@ -130,7 +130,7 @@ export function getLoggedInData(lang: string) {
? hiLoggedInData
: enLoggedInData

return mergeDeepRight(enData, data) as typeof enLoggedInData
return mergeDeepRight(enData, data)
}

export function getKratosMailStrings(lang: string) {
Expand All @@ -149,7 +149,7 @@ export function getKratosMailStrings(lang: string) {
? hiKratosMailStrings
: enKratosMailStrings

return mergeDeepRight(enData, data) as typeof enKratosMailStrings
return mergeDeepRight(enData, data)
}

export function getEntityStringByTypename(
Expand Down
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@
"name": "@serlo/monorepo",
"version": "0.0.1",
"private": true,
"repository": "serlo/frontend",
"bugs": {
"url": "https://github.com/serlo/frontend/issues"
},
"repository": "serlo/frontend",
"license": "Apache-2.0",
"author": "Serlo Education e.V.",
"workspaces": [
"apps/*",
"packages/*"
],
"scripts": {
":format:prettier": "yarn prettier . '!{apps,packages}/**/*' --write",
":prettier": "yarn prettier . '!{apps,packages}/**/*' --check",
"build": "yarn workspace @serlo/frontend build",
"build:next": "yarn workspace @serlo/frontend build:next",
"build:prisma": "yarn workspace @serlo/frontend build:prisma",
Expand All @@ -29,15 +31,14 @@
"lint:prettier": "yarn workspace @serlo/frontend lint:prettier",
"lint:tsc": "yarn workspace @serlo/frontend lint:tsc",
"start": "yarn workspace @serlo/frontend start",
"test": "yarn workspace @serlo/frontend test",
"global:prettier": "yarn prettier . --check",
"global:format:prettier": "yarn prettier . --write"
"test": "yarn workspace @serlo/frontend test"
},
"devDependencies": {
"prettier": "^3.1.0",
"prettier-plugin-packagejson": "^2.4.6"
},
"packageManager": "[email protected]",
"engines": {
"node": "^18.0.0"
},
"devDependencies": {
"prettier": "^3.1.0"
}
}
1 change: 1 addition & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4240,6 +4240,7 @@ __metadata:
resolution: "@serlo/monorepo@workspace:."
dependencies:
prettier: ^3.1.0
prettier-plugin-packagejson: ^2.4.6
languageName: unknown
linkType: soft

Expand Down

0 comments on commit 76d8c42

Please sign in to comment.