-
Notifications
You must be signed in to change notification settings - Fork 0
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
Prettier #9
base: main
Are you sure you want to change the base?
Conversation
.prettierrc.js
Outdated
jsxBracketSameLine: false, | ||
arrowParens: "always", | ||
parser: "typescript", | ||
endOfLine: "crlf", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we shouldn't change the default setting here. In most cases, this code will run on Linux machines so "lf" could be better
app/auth/components/LoginForm.tsx
Outdated
}} | ||
> | ||
<LabeledTextField name="email" label="Email" placeholder="Email" /> | ||
<LabeledTextField name="password" label="Password" placeholder="Password" type="password" /> | ||
<div> | ||
<Link href={Routes.ForgotPasswordPage()}> | ||
<a>Forgot your password?</a> | ||
<a href="/">Forgot your password?</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this link work correctly when you added another href for the a
element?
app/auth/mutations/login.ts
Outdated
@@ -17,7 +17,7 @@ export const authenticateUser = async (rawEmail: string, rawPassword: string) => | |||
await db.user.update({ where: { id: user.id }, data: { hashedPassword: improvedHash } }) | |||
} | |||
|
|||
const { hashedPassword, ...rest } = user | |||
const { ...rest } = user |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't seem right:
- Why we are destructuring the user if we return the entire result anyway.
- The previous intention (to not include the password in the response) has been changed without a good reason.
If this change is a result of a linter error, you should use the omit function from lodash or some equivalent. As a result, you will return the user but without thehashadPassword
property.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a linter error about assigned value and never used it. By omit function you mean to disable
eslint for this line?
@@ -3,7 +3,7 @@ import { sessionMiddleware, simpleRolesIsAuthorized } from "blitz" | |||
module.exports = { | |||
middleware: [ | |||
sessionMiddleware({ | |||
cookiePrefix: 'CodersCrewApp', | |||
cookiePrefix: "CodersCrewApp", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we have double quotes here when we set Prettier to use single ones?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know why but when I try to change to single quotes I get an error from eslint and prettier/lint change this to double quotes on save. So this is the reason.
I tired to fix it but it didn't work. Should I try more or leave this? I'm not good in lint :(
package.json
Outdated
"eslint-config-airbnb-base": "14.2.1", | ||
"eslint-config-prettier": "8.3.0", | ||
"eslint-import-resolver-typescript": "2.4.0", | ||
"eslint-plugin-import": "^2.20.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use pinned versions of libraries (without the ^
)
No description provided.