Skip to content

Commit 1d79e07

Browse files
committed
chore: introduce prettier
1 parent 8cd5ecf commit 1d79e07

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1127
-1119
lines changed

.eslintrc.cjs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/** @type {import('eslint').Linter.Config} */
22
module.exports = {
3-
extends: ["@remix-run/eslint-config", "@remix-run/eslint-config/node"],
3+
extends: ['@remix-run/eslint-config', '@remix-run/eslint-config/node'],
44
rules: {
5-
"react-hooks/exhaustive-deps": [
6-
"warn",
5+
'react-hooks/exhaustive-deps': [
6+
'warn',
77
{
8-
additionalHooks: "useMutation",
8+
additionalHooks: 'useMutation',
99
},
1010
],
1111
},
12-
};
12+
}

.prettierrc

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"arrowParens": "always",
3+
"bracketSpacing": true,
4+
"embeddedLanguageFormatting": "auto",
5+
"htmlWhitespaceSensitivity": "css",
6+
"insertPragma": false,
7+
"jsxBracketSameLine": false,
8+
"jsxSingleQuote": false,
9+
"printWidth": 80,
10+
"proseWrap": "preserve",
11+
"quoteProps": "as-needed",
12+
"requirePragma": false,
13+
"semi": false,
14+
"singleQuote": true,
15+
"tabWidth": 2,
16+
"trailingComma": "es5",
17+
"useTabs": false,
18+
"vueIndentScriptAndStyle": false
19+
}

.vscode/utils.code-snippets

+12-34
Original file line numberDiff line numberDiff line change
@@ -2,74 +2,52 @@
22
"export function": {
33
"scope": "typescript,javascript,javascriptreact,typescriptreact",
44
"prefix": "exp",
5-
"body": [
6-
"export function $1 () {",
7-
"return ($2)",
8-
"}"
9-
]
5+
"body": ["export function $1 () {", "return ($2)", "}"],
106
},
117
"sr only styles": {
128
"scope": "typescript,javascript,javascriptreact,typescriptreact",
139
"prefix": "sro",
14-
"body": [
15-
"sr-only"
16-
]
10+
"body": ["sr-only"],
1711
},
1812
"class": {
1913
"scope": "typescript,javascript,javascriptreact,typescriptreact",
2014
"prefix": "cls",
21-
"body": [
22-
"className=\"$1\""
23-
]
15+
"body": ["className=\"$1\""],
2416
},
2517
"export everything": {
2618
"scope": "typescript,javascript,javascriptreact,typescriptreact",
2719
"prefix": "exev",
28-
"body": [
29-
"export * from './$1'"
30-
]
20+
"body": ["export * from './$1'"],
3121
},
3222
"playwright to be defined": {
3323
"scope": "typescript,javascript,javascriptreact,typescriptreact",
3424
"prefix": "ebf",
35-
"body": [
36-
"await expect($1).toBeDefined()"
37-
]
25+
"body": ["await expect($1).toBeDefined()"],
3826
},
3927
"playwright to be visible": {
4028
"scope": "typescript,javascript,javascriptreact,typescriptreact",
4129
"prefix": "ebv",
42-
"body": [
43-
"await expect($1).toBeVisible()"
44-
]
30+
"body": ["await expect($1).toBeVisible()"],
4531
},
4632
"Write calculated font size": {
4733
"scope": "css",
4834
"prefix": "fnz",
49-
"body": [
50-
"font-size: calc(1rem * $1 / 16);"
51-
],
52-
"description": "Write the font size which calculates pixels and rem divided. Used to better understand the size of the font, but still let them be accessible as rems in the browser."
35+
"body": ["font-size: calc(1rem * $1 / 16);"],
36+
"description": "Write the font size which calculates pixels and rem divided. Used to better understand the size of the font, but still let them be accessible as rems in the browser.",
5337
},
5438
"Write media query": {
5539
"scope": "css",
5640
"prefix": "mdq",
57-
"body": [
58-
"@media screen and (min-width: $1) {$2}"
59-
]
41+
"body": ["@media screen and (min-width: $1) {$2}"],
6042
},
6143
"colors primary": {
6244
"scope": "css",
6345
"prefix": "clrp",
64-
"body": [
65-
"var(--colors-primary-$1)"
66-
]
46+
"body": ["var(--colors-primary-$1)"],
6747
},
6848
"colors": {
6949
"scope": "css",
7050
"prefix": "clr",
71-
"body": [
72-
"var(--colors-$1)"
73-
]
74-
}
51+
"body": ["var(--colors-$1)"],
52+
},
7553
}

ARCHITECTURE.md

+9-11
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ For authentication, the project uses HTTP cookies, which are straightforward to
2929
How you declare cookiee in Remix:
3030

3131
```javascript
32-
const authCookie = createCookie("auth", {
32+
const authCookie = createCookie('auth', {
3333
secrets: [secret],
3434
maxAge: 30 * 24 * 60 * 60,
3535
httpOnly: true,
36-
secure: env.NODE_ENV === "production",
37-
sameSite: "lax",
38-
});
36+
secure: env.NODE_ENV === 'production',
37+
sameSite: 'lax',
38+
})
3939
```
4040

4141
- secrets: An array of secrets that may be used to sign/unsign the value of a cookie.
@@ -64,14 +64,12 @@ How we create the hash:
6464
// 16 bytes is the recommended size for a salt
6565
// Having a salt added to the password before hashing it makes it more secure
6666
// Reduces the risk of rainbow table attacks: https://en.wikipedia.org/wiki/PBKDF2
67-
let salt = crypto.randomBytes(16).toString("hex");
67+
let salt = crypto.randomBytes(16).toString('hex')
6868

6969
// Create a hash
7070
// 1000 stands for the number of iterations
7171
// 64 is the length of the output hash
72-
let hash = crypto
73-
.pbkdf2Sync(password, salt, 1000, 64, "sha256")
74-
.toString("hex");
72+
let hash = crypto.pbkdf2Sync(password, salt, 1000, 64, 'sha256').toString('hex')
7573
```
7674

7775
The salt is created using `crypto.randomBytes` and the hash is created using `crypto.pbkdf2Sync`.
@@ -80,11 +78,11 @@ How we compare the hash when a user logs in:
8078

8179
```js
8280
let hash = crypto
83-
.pbkdf2Sync(password, user.Password.salt, 1000, 64, "sha256")
84-
.toString("hex");
81+
.pbkdf2Sync(password, user.Password.salt, 1000, 64, 'sha256')
82+
.toString('hex')
8583

8684
if (hash !== user.Password.hash) {
87-
return false;
85+
return false
8886
}
8987
```
9088

0 commit comments

Comments
 (0)