From b0e1b4a4a6ce2182eb66a7e4c8778461196912c5 Mon Sep 17 00:00:00 2001 From: IlyaDoronin Date: Fri, 10 May 2024 12:12:57 +0300 Subject: [PATCH] feat: prettier --- .prettierrc | 12 ++++ package.json | 6 +- src/index.tsx | 180 ++++++++++++++++++++++++-------------------------- yarn.lock | 5 ++ 4 files changed, 109 insertions(+), 94 deletions(-) create mode 100644 .prettierrc diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..5a7509c --- /dev/null +++ b/.prettierrc @@ -0,0 +1,12 @@ +{ + "semi": true, + "trailingComma": "es5", + "singleQuote": false, + "printWidth": 120, + "tabWidth": 2, + "useTabs": true, + "endOfLine": "auto", + "bracketSpacing": true, + "arrowParens": "always", + "jsxSingleQuote": false +} diff --git a/package.json b/package.json index 18a44dd..9ebd058 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,8 @@ "test:cart": "craco test src/utils/calcCart --transformIgnorePatterns \"node_modules/(?!@frontend)/\"", "test:cypress": "start-server-and-test start http://localhost:3000 cypress", "cypress": "cypress open", - "eject": "craco eject" + "eject": "craco eject", + "format": "prettier . --write" }, "eslintConfig": { "extends": [ @@ -77,6 +78,7 @@ ] }, "devDependencies": { - "craco-alias": "^3.0.1" + "craco-alias": "^3.0.1", + "prettier": "^3.2.5" } } diff --git a/src/index.tsx b/src/index.tsx index dcff6e9..7b027f2 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -30,103 +30,99 @@ import theme from "./theme"; import "./index.css"; const componentsArray = [ - ["/users", ], - ["/users/:userId", ], - ["/entities", ], - ["/tariffs", ], - ["/discounts", ], - ["/promocode", ], - ["/support", ], - ["/support/:ticketId", ], + ["/users", ], + ["/users/:userId", ], + ["/entities", ], + ["/tariffs", ], + ["/discounts", ], + ["/promocode", ], + ["/support", ], + ["/support/:ticketId", ], ] as const; const container = document.getElementById("root"); const root = createRoot(container!); root.render( - - - - - - - - - - } - /> - - - - } - /> - - - - } - /> - - - - } - /> - - - - } - /> - - - - } - > - - - - } - /> - - - - } - /> - {componentsArray.map((element) => ( - - ))} - - } /> + + + + + + + + + + } + /> + + + + } + /> + + + + } + /> + + + + } + /> + + + + } + /> + + + + } + > + + + + } + /> + + + + } + /> + {componentsArray.map((element) => ( + + ))} + + } /> - } /> - - - - - + } /> + + + + + ); diff --git a/yarn.lock b/yarn.lock index d34086c..dac211d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10577,6 +10577,11 @@ prelude-ls@~1.1.2: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" integrity sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w== +prettier@^3.2.5: + version "3.2.5" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.2.5.tgz#e52bc3090586e824964a8813b09aba6233b28368" + integrity sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A== + pretty-bytes@^5.3.0, pretty-bytes@^5.4.1, pretty-bytes@^5.6.0: version "5.6.0" resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.6.0.tgz#356256f643804773c82f64723fe78c92c62beaeb"