From 2f8ff0d004d99555b43883ece95c764de3e5d654 Mon Sep 17 00:00:00 2001 From: andres Date: Sat, 17 Aug 2024 17:30:56 +0200 Subject: [PATCH] chore: add prettier and run it on all files --- .prettierrc | 7 + package.json | 115 +++---- public/index.html | 27 +- src/api/todolists-api.ts | 194 ++++++------ src/app/App.tsx | 133 ++++---- src/app/app-reducer.test.ts | 28 +- src/app/app-reducer.ts | 80 ++--- src/app/store.ts | 37 ++- src/components/AddItemForm/AddItemForm.tsx | 93 +++--- src/components/EditableSpan/EditableSpan.tsx | 49 +-- .../ErrorSnackbar/ErrorSnackbar.tsx | 70 +++-- src/features/Login/Login.tsx | 179 ++++++----- src/features/Login/auth-reducer.ts | 113 ++++--- .../TodolistsList/Todolist/Task/Task.tsx | 77 +++-- .../TodolistsList/Todolist/Todolist.tsx | 195 +++++++----- src/features/TodolistsList/TodolistsList.tsx | 220 ++++++++------ .../TodolistsList/tasks-reducer.test.ts | 270 +++++++++++------ src/features/TodolistsList/tasks-reducer.ts | 286 +++++++++++------- .../TodolistsList/todolists-reducer.test.ts | 113 ++++--- .../TodolistsList/todolists-reducer.ts | 199 +++++++----- .../todolists-tasks-reducer.test.ts | 44 +-- src/hooks/useAppDispatch.ts | 7 +- src/index.tsx | 24 +- src/serviceWorker.ts | 81 +++-- src/setupTests.ts | 2 +- src/utils/error-utils.ts | 37 ++- tsconfig.json | 10 +- yarn.lock | 36 ++- 28 files changed, 1609 insertions(+), 1117 deletions(-) create mode 100644 .prettierrc diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..e044e84 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,7 @@ +{ + "semi": false, + "singleQuote": true, + "jsxSingleQuote": true, + "trailingComma": "es5", + "singleAttributePerLine": true +} diff --git a/package.json b/package.json index 40e2f39..ad6bc70 100644 --- a/package.json +++ b/package.json @@ -1,58 +1,61 @@ { - "name": "it-incubator-todolist-ts", - "jest": { - "moduleNameMapper": { - "axios": "axios/dist/node/axios.cjs" - } - }, - "version": "0.1.0", - "private": true, - "dependencies": { - "@babel/runtime": "^7.23.7", - "@emotion/react": "^11.11.3", - "@emotion/styled": "^11.11.0", - "@mui/icons-material": "^5.15.2", - "@mui/material": "^5.15.2", - "@reduxjs/toolkit": "^2.0.1", - "@testing-library/jest-dom": "^6.1.6", - "@testing-library/react": "^14.1.2", - "@testing-library/user-event": "^14.5.2", - "@types/jest": "^29.5.11", - "@types/node": "^20.10.6", - "@types/react": "^18.2.46", - "@types/react-dom": "^18.2.18", - "@types/uuid": "^9.0.7", - "axios": "^1.6.3", - "formik": "^2.4.5", - "react": "^18.2.0", - "react-dom": "^18.2.0", - "react-redux": "^9.0.4", - "react-router-dom": "^6.21.1", - "react-scripts": "^5.0.1", - "redux": "^5.0.1", - "redux-thunk": "^3.1.0", - "typescript": "^5.3.3", - "uuid": "^9.0.1" - }, - "scripts": { - "start": "react-scripts start", - "build": "react-scripts build", - "test": "react-scripts test", - "eject": "react-scripts eject" - }, - "eslintConfig": { - "extends": "react-app" - }, - "browserslist": { - "production": [ - ">0.2%", - "not dead", - "not op_mini all" - ], - "development": [ - "last 1 chrome version", - "last 1 firefox version", - "last 1 safari version" - ] - } + "name": "it-incubator-todolist-ts", + "jest": { + "moduleNameMapper": { + "axios": "axios/dist/node/axios.cjs" + } + }, + "version": "0.1.0", + "private": true, + "dependencies": { + "@babel/runtime": "^7.23.7", + "@emotion/react": "^11.11.3", + "@emotion/styled": "^11.11.0", + "@mui/icons-material": "^5.15.2", + "@mui/material": "^5.15.2", + "@reduxjs/toolkit": "^2.0.1", + "@testing-library/jest-dom": "^6.1.6", + "@testing-library/react": "^14.1.2", + "@testing-library/user-event": "^14.5.2", + "@types/jest": "^29.5.11", + "@types/node": "^20.10.6", + "@types/react": "^18.2.46", + "@types/react-dom": "^18.2.18", + "@types/uuid": "^9.0.7", + "axios": "^1.6.3", + "formik": "^2.4.5", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "react-redux": "^9.0.4", + "react-router-dom": "^6.21.1", + "react-scripts": "^5.0.1", + "redux": "^5.0.1", + "redux-thunk": "^3.1.0", + "typescript": "^5.3.3", + "uuid": "^9.0.1" + }, + "scripts": { + "start": "react-scripts start", + "build": "react-scripts build", + "test": "react-scripts test", + "eject": "react-scripts eject" + }, + "eslintConfig": { + "extends": "react-app" + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + }, + "devDependencies": { + "prettier": "3.3.3" + } } diff --git a/public/index.html b/public/index.html index aa069f2..aa50600 100644 --- a/public/index.html +++ b/public/index.html @@ -1,20 +1,35 @@ - + - - - + + + - + - +