Created
October 3, 2025 21:26
-
-
Save solarkraft/78d1ccb94f9a1507cb8ab5cacdc7ced7 to your computer and use it in GitHub Desktop.
Customize formatting on Vite React+TS project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| From 09c136006b11872d7b9d713440b2566a5f4f36c3 Mon Sep 17 00:00:00 2001 | |
| From: solarkraft <> | |
| Date: Fri, 3 Oct 2025 23:24:20 +0200 | |
| Subject: [PATCH] Set up formatting | |
| --- | |
| .prettierignore | 3 +++ | |
| .prettierrc | 6 ++++++ | |
| .vscode/settings.json | 4 ++++ | |
| package.json | 4 +++- | |
| 4 files changed, 16 insertions(+), 1 deletion(-) | |
| create mode 100644 .prettierignore | |
| create mode 100644 .prettierrc | |
| create mode 100644 .vscode/settings.json | |
| diff --git a/.prettierignore b/.prettierignore | |
| new file mode 100644 | |
| index 0000000..31e6cd8 | |
| --- /dev/null | |
| +++ b/.prettierignore | |
| @@ -0,0 +1,3 @@ | |
| +pnpm-lock.yaml | |
| +node_modules | |
| +dist | |
| diff --git a/.prettierrc b/.prettierrc | |
| new file mode 100644 | |
| index 0000000..036f4d0 | |
| --- /dev/null | |
| +++ b/.prettierrc | |
| @@ -0,0 +1,6 @@ | |
| +{ | |
| + "useTabs": true, | |
| + "tabWidth": 4, | |
| + "semi": false, | |
| + "printWidth": 120 | |
| +} | |
| diff --git a/.vscode/settings.json b/.vscode/settings.json | |
| new file mode 100644 | |
| index 0000000..bb2c526 | |
| --- /dev/null | |
| +++ b/.vscode/settings.json | |
| @@ -0,0 +1,4 @@ | |
| +{ | |
| + "editor.formatOnPaste": true, | |
| + "editor.formatOnSave": true | |
| +} | |
| diff --git a/package.json b/package.json | |
| index ec67391..4cae1bd 100644 | |
| --- a/package.json | |
| +++ b/package.json | |
| @@ -7,7 +7,8 @@ | |
| "dev": "vite", | |
| "build": "tsc -b && vite build", | |
| "lint": "eslint .", | |
| - "preview": "vite preview" | |
| + "preview": "vite preview", | |
| + "format": "prettier --write ." | |
| }, | |
| "dependencies": { | |
| "react": "^19.1.1", | |
| @@ -22,6 +23,7 @@ | |
| "eslint-plugin-react-hooks": "^5.2.0", | |
| "eslint-plugin-react-refresh": "^0.4.20", | |
| "globals": "^16.4.0", | |
| + "prettier": "^3.6.2", | |
| "typescript": "~5.8.3", | |
| "typescript-eslint": "^8.44.0", | |
| "vite": "^7.1.7" | |
| -- | |
| 2.50.1 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment