Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump Prettier #625

Merged
merged 6 commits into from
Jan 31, 2024
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
4 changes: 2 additions & 2 deletions frontend/.env.preview
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
VITE_DEFAULT_LOCALE=sk
VITE_FALLBACK_LOCALE=sk
VITE_DEFAULT_LOCALE=sk
VITE_FALLBACK_LOCALE=sk
3 changes: 2 additions & 1 deletion frontend/.prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
singleQuote: true
endOfLine: lf
overrides:
- files: ['.env', '.env.*']
options:
parser: 'sh'
plugins:
- prettier-plugin-sh
4 changes: 2 additions & 2 deletions frontend/api/auth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
const PUBLIC_URL = process.env.PUBLIC_URL
? process.env.PUBLIC_URL
: process.env.VERCEL_URL
? `https://${process.env.VERCEL_URL}`
: null;
? `https://${process.env.VERCEL_URL}`
: null;
const OAUTH_CALLBACK_URL = process.env.OAUTH_CALLBACK_URL || PUBLIC_URL;

if (!PUBLIC_URL) {
Expand Down Expand Up @@ -69,7 +69,7 @@
accessToken: string | null,
refreshToken: string | null,
profile: Profile | { destination: string },
cb: (error: any, user?: any, info?: any) => void,

Check warning on line 72 in frontend/api/auth/index.ts

View workflow job for this annotation

GitHub Actions / Build, test & lint

Unexpected any. Specify a different type

Check warning on line 72 in frontend/api/auth/index.ts

View workflow job for this annotation

GitHub Actions / Build, test & lint

Unexpected any. Specify a different type

Check warning on line 72 in frontend/api/auth/index.ts

View workflow job for this annotation

GitHub Actions / Build, test & lint

Unexpected any. Specify a different type
) => {
let email: string | undefined;
if (strategy === 'magiclogin') {
Expand Down Expand Up @@ -192,7 +192,7 @@

const callback = (provider: string) => {
return (req: Request, res: Response, next: NextFunction) => {
passport.authenticate(provider, { session: false }, (err, user, info) => {

Check warning on line 195 in frontend/api/auth/index.ts

View workflow job for this annotation

GitHub Actions / Build, test & lint

'info' is defined but never used
if (err || !user) {
return res.redirect('/' + '?error=' + err?.message);
}
Expand Down Expand Up @@ -315,6 +315,6 @@
export default function (req: VercelRequest, res: VercelResponse) {
// This reads request readable stream and parses it as JSON
// Needed for parsing request body in Vercel
const { body } = req;

Check warning on line 318 in frontend/api/auth/index.ts

View workflow job for this annotation

GitHub Actions / Build, test & lint

'body' is assigned a value but never used
return app(req, res);
}
4 changes: 2 additions & 2 deletions frontend/cypress/e2e/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"isolatedModules": false,
"target": "es5",
"lib": ["es5", "dom"],
"types": ["cypress"]
}
"types": ["cypress"],
},
}
4 changes: 2 additions & 2 deletions frontend/docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ If you need to work just with the frontend, the easiest way is to run just Vue f
```sh
DATA_PROXY=https://volebnikalkulacka.cz
API_PROXY=https://volebnikalkulacka.cz

```

Expand Down Expand Up @@ -89,7 +89,7 @@ To run also backend serverless functions locally, you can use [Vercel CLI](https

```sh

DATABASE_NAME=defaultdb
DATABASE_URL_BASE=postgresql://john-doe:HUVAkcJHcpffDZuSuQLmwN@john-doe-development-5467.7tc.cockroachlabs.cloud:26257
DATABASE_URL=${DATABASE_URL_BASE}/${DATABASE_NAME}
Expand Down
32 changes: 16 additions & 16 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"@types/seedrandom": "^3.0.4",
"@vercel/node": "^2.6.3",
"@vitejs/plugin-vue": "^4.0.0",
"@vue/eslint-config-prettier": "^8.0.0",
"@vue/eslint-config-prettier": "^9.0.0",
"@vue/eslint-config-typescript": "^11.0.0",
"@vue/test-utils": "^2.0.2",
"@vue/tsconfig": "^0.4.0",
Expand All @@ -85,7 +85,7 @@
"passport-google-oauth20": "^2.0.0",
"passport-magic-login": "^1.2.2",
"prettier": "^3.0.0",
"prettier-plugin-sh": "^0.13.1",
"prettier-plugin-sh": "^0.14.0",
"prisma": "^5.0.0",
"sass": "^1.54.3",
"sass-loader": "^13.0.2",
Expand Down
12 changes: 6 additions & 6 deletions frontend/src/common/dataFetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,12 @@ export const deprecatedFetchCalculator = async (key: string) => {
answer.answer === true
? 'yes'
: answer.answer === false
? 'no'
: answer.answer === null
? 'dont_know'
: (() => {
throw new Error(`Unexpected answer value: ${answer.answer}`);
})();
? 'no'
: answer.answer === null
? 'dont_know'
: (() => {
throw new Error(`Unexpected answer value: ${answer.answer}`);
})();

transformedCandidatesAnswers.push({
id: answer.questionId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ const classes = ['status-bar-primary', 'status-bar-secondary'];
question.answer === UserAnswerEnum.yes
? classes[0]
: question.answer === UserAnswerEnum.no
? classes[1]
: '',
? classes[1]
: '',
index === currentQuestion ? 'active' : '',
]"
></div>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/routes/recap/RecapPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ const handleShowResultsClick = () => {

const availableTags: Set<string> = new Set(['All']);
const selectedTag = ref('All');
electionStore.calculator?.questions.forEach(
(q) => q.tags?.forEach((tag) => availableTags.add(tag)),
electionStore.calculator?.questions.forEach((q) =>
q.tags?.forEach((tag) => availableTags.add(tag)),
);

const handleStarClick = (index: number) => {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/routes/result/ResultCategory.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ const visibleCandidates = computed(() =>
isExpanded.value
? props.result.length
: props.maxVisibleCandidates > props.result.length
? props.result.length
: props.maxVisibleCandidates,
? props.result.length
: props.maxVisibleCandidates,
);
console.debug(visibleCandidates.value);
</script>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/server/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export async function authUser(
const PUBLIC_URL = process.env.PUBLIC_URL
? process.env.PUBLIC_URL
: process.env.VERCEL_URL
? `https://${process.env.VERCEL_URL}`
: null;
? `https://${process.env.VERCEL_URL}`
: null;
if (!tokenString) {
return null;
}
Expand Down
10 changes: 5 additions & 5 deletions frontend/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
"files": [],
"references": [
{
"path": "./tsconfig.node.json"
"path": "./tsconfig.node.json",
},
{
"path": "./tsconfig.vitest.json"
"path": "./tsconfig.vitest.json",
},
{
"path": "./tsconfig.app.json"
}
]
"path": "./tsconfig.app.json",
},
],
}
Loading