Skip to content

Commit 91526fd

Browse files
Adding prettier pre-commit hook
1 parent cd8ac3b commit 91526fd

File tree

95 files changed

+1047
-349
lines changed

Some content is hidden

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

95 files changed

+1047
-349
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ dist-ssr
1515
# Editor directories and files
1616
.vscode/*
1717
!.vscode/extensions.json
18+
!.vscode/settings.json
1819
.idea
1920
.DS_Store
2021
*.suo

.husky/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx lint-staged

.vscode/extensions.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["esbenp.prettier-vscode"]
3+
}

.vscode/settings.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"[javascript]": {
3+
"editor.defaultFormatter": "esbenp.prettier-vscode"
4+
},
5+
"[javascriptreact]": {
6+
"editor.defaultFormatter": "esbenp.prettier-vscode"
7+
},
8+
"[json]": {
9+
"editor.defaultFormatter": "esbenp.prettier-vscode"
10+
},
11+
"[jsonc]": {
12+
"editor.defaultFormatter": "esbenp.prettier-vscode"
13+
},
14+
"[markdown]": {
15+
"editor.defaultFormatter": "esbenp.prettier-vscode"
16+
},
17+
"[typescript]": {
18+
"editor.defaultFormatter": "esbenp.prettier-vscode"
19+
},
20+
"[typescriptreact]": {
21+
"editor.defaultFormatter": "esbenp.prettier-vscode"
22+
},
23+
"prettier.prettierPath": "./node_modules/prettier",
24+
"typescript.tsdk": "node_modules/typescript/lib"
25+
}

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
## Prerequisites
2+
23
- Node 20+
34

45
## Install
6+
57
- `sudo npm install -g [email protected]`
68
- `curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash`
79
- `nvm install 22 && nvm use 22`
810

911
## Build
12+
1013
- Run `npm ci`
1114
- Run `npm run build`
1215
- Serve static assets in `./dist` with preferred tool. Ex. `npx run serve`

eslint.config.mjs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import reactRefresh from "eslint-plugin-react-refresh";
77

88
// Override type, the analyzer misses eslint-plugin-react's flat configs
99
/** @type {typeof eslintReact.configs} */
10-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
1110
const eslintReactConfigsFlat = eslintReact.configs.flat;
1211

1312
// eslint-plugin-react-hooks specifies an incorrect value for `plugins`
@@ -25,10 +24,10 @@ export default tseslint.config(
2524
eslintReactConfigsFlat["jsx-runtime"],
2625
eslintReactHooksFlat.recommended,
2726
prettier,
27+
{ ignores: ["**/dist/"] },
2828
{
2929
plugins: {
3030
"@typescript-eslint": tseslint.plugin,
31-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
3231
"react-refresh": reactRefresh,
3332
},
3433

@@ -62,7 +61,7 @@ export default tseslint.config(
6261
"@typescript-eslint/ban-ts-comment": "off",
6362
"@typescript-eslint/restrict-template-expressions": [
6463
"error",
65-
{ allowNumber: true, allowBoolean: true, },
64+
{ allowNumber: true, allowBoolean: true },
6665
],
6766
"@typescript-eslint/no-unsafe-enum-comparison": "off",
6867
"@typescript-eslint/prefer-promise-reject-errors": [
@@ -107,5 +106,5 @@ export default tseslint.config(
107106
"@typescript-eslint/no-useless-constructor": "warn",
108107
"react/prop-types": "off",
109108
},
110-
}
109+
},
111110
);

0 commit comments

Comments
 (0)