From 86f09f46cea6d9f3058fdb58cdae81710e60f3e6 Mon Sep 17 00:00:00 2001 From: noah Date: Sat, 7 May 2022 21:59:27 +0900 Subject: [PATCH 1/3] Install prettier --- ui/.prettierignore | 2 ++ ui/.prettierrc.json | 5 +++++ ui/package-lock.json | 23 +++++++++++++++++++++++ ui/package.json | 5 +++-- 4 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 ui/.prettierignore create mode 100644 ui/.prettierrc.json diff --git a/ui/.prettierignore b/ui/.prettierignore new file mode 100644 index 00000000..227b71fe --- /dev/null +++ b/ui/.prettierignore @@ -0,0 +1,2 @@ +build +coverage \ No newline at end of file diff --git a/ui/.prettierrc.json b/ui/.prettierrc.json new file mode 100644 index 00000000..6a8af5e9 --- /dev/null +++ b/ui/.prettierrc.json @@ -0,0 +1,5 @@ +{ + "tabWidth": 2, + "semi": true, + "singleQuote": true +} diff --git a/ui/package-lock.json b/ui/package-lock.json index fd07218e..177b63dd 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -5,6 +5,7 @@ "requires": true, "packages": { "": { + "name": "ui", "version": "0.1.0", "dependencies": { "@craco/craco": "^6.1.2", @@ -37,6 +38,7 @@ "@typescript-eslint/eslint-plugin": "^4.28.4", "@typescript-eslint/parser": "^4.28.4", "eslint": "^7.31.0", + "prettier": "2.6.2", "typescript": "^4.3.5" } }, @@ -15036,6 +15038,21 @@ "node": ">=0.10.0" } }, + "node_modules/prettier": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.2.tgz", + "integrity": "sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew==", + "dev": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/pretty-bytes": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz", @@ -33451,6 +33468,12 @@ "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=" }, + "prettier": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.2.tgz", + "integrity": "sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew==", + "dev": true + }, "pretty-bytes": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz", diff --git a/ui/package.json b/ui/package.json index e3dfb418..51c898d4 100644 --- a/ui/package.json +++ b/ui/package.json @@ -10,6 +10,7 @@ "@testing-library/user-event": "^12.8.3", "antd": "^4.16.1", "craco-less": "^1.17.1", + "follow-redirects": "^1.14.7", "http-status-codes": "^2.1.4", "lodash.debounce": "^4.0.8", "moment": "^2.29.1", @@ -19,8 +20,7 @@ "react-redux": "^7.2.4", "react-router-dom": "^5.2.0", "react-scripts": "4.0.3", - "web-vitals": "^1.1.2", - "follow-redirects": "^1.14.7" + "web-vitals": "^1.1.2" }, "scripts": { "start": "craco start", @@ -58,6 +58,7 @@ "@typescript-eslint/eslint-plugin": "^4.28.4", "@typescript-eslint/parser": "^4.28.4", "eslint": "^7.31.0", + "prettier": "2.6.2", "typescript": "^4.3.5" } } From 4619f7cdcb3d4a803951391dbb3d3cf42584f4e6 Mon Sep 17 00:00:00 2001 From: noah Date: Sat, 7 May 2022 22:04:19 +0900 Subject: [PATCH 2/3] Run prettier --- ui/.eslintrc.js | 24 +- ui/craco.config.js | 8 +- ui/public/index.html | 5 +- ui/src/App.less | 8 +- ui/src/App.tsx | 78 +- ui/src/apis/_base.ts | 37 +- ui/src/apis/branch.ts | 83 +- ui/src/apis/chat.ts | 26 +- ui/src/apis/commit.ts | 243 ++--- ui/src/apis/config.ts | 93 +- ui/src/apis/deployment.ts | 546 ++++++----- ui/src/apis/events.ts | 57 +- ui/src/apis/index.ts | 101 +-- ui/src/apis/license.ts | 42 +- ui/src/apis/lock.ts | 219 +++-- ui/src/apis/perm.ts | 73 +- ui/src/apis/repo.ts | 362 ++++---- ui/src/apis/review.ts | 288 +++--- ui/src/apis/setting.ts | 18 +- ui/src/apis/sync.ts | 16 +- ui/src/apis/tag.ts | 85 +- ui/src/apis/user.ts | 239 ++--- ui/src/components/ActivateButton.tsx | 39 +- ui/src/components/CreatableSelect.tsx | 129 +-- ui/src/components/DeploymentRefCode.tsx | 39 +- ui/src/components/DeploymentStatusBadge.tsx | 56 +- ui/src/components/Pagination.tsx | 36 +- ui/src/components/RecentActivities.tsx | 140 +-- ui/src/components/Spin.tsx | 8 +- ui/src/components/UserAvatar.tsx | 36 +- .../components/partials/deploymentStatus.tsx | 40 +- ui/src/components/partials/index.tsx | 4 +- ui/src/index.tsx | 6 +- ui/src/libs/index.ts | 12 +- ui/src/models/Branch.ts | 6 +- ui/src/models/Commit.ts | 38 +- ui/src/models/Config.ts | 44 +- ui/src/models/Deployment.ts | 78 +- ui/src/models/Event.ts | 26 +- ui/src/models/License.ts | 8 +- ui/src/models/Lock.ts | 14 +- ui/src/models/Perm.ts | 16 +- ui/src/models/Repo.ts | 24 +- ui/src/models/Request.ts | 10 +- ui/src/models/Review.ts | 26 +- ui/src/models/Tag.ts | 6 +- ui/src/models/User.ts | 32 +- ui/src/models/errors.ts | 68 +- ui/src/models/index.ts | 140 +-- ui/src/redux/activities.tsx | 115 +-- ui/src/redux/deployment.tsx | 477 +++++----- ui/src/redux/home.ts | 173 ++-- ui/src/redux/hooks.ts | 8 +- ui/src/redux/main.ts | 446 ++++----- ui/src/redux/members.ts | 205 +++-- ui/src/redux/repo.ts | 136 +-- ui/src/redux/repoDeploy.tsx | 851 ++++++++++-------- ui/src/redux/repoHome.ts | 142 +-- ui/src/redux/repoLock.ts | 310 +++---- ui/src/redux/repoRollback.tsx | 408 +++++---- ui/src/redux/repoSettings.tsx | 226 ++--- ui/src/redux/settings.ts | 115 +-- ui/src/redux/store.ts | 42 +- ui/src/views/activities/ActivityHistory.tsx | 68 +- ui/src/views/activities/SearchActivities.tsx | 118 +-- ui/src/views/activities/index.tsx | 199 ++-- ui/src/views/deployment/CommitChanges.tsx | 147 +-- .../views/deployment/DeploymentDescriptor.tsx | 124 +-- .../deployment/DeploymentStatusSteps.tsx | 81 +- ui/src/views/deployment/HeaderBreadcrumb.tsx | 49 +- ui/src/views/deployment/ReviewButton.tsx | 134 +-- ui/src/views/deployment/ReviewList.tsx | 120 +-- ui/src/views/deployment/index.tsx | 454 +++++----- ui/src/views/home/RepoList.tsx | 84 +- ui/src/views/home/index.tsx | 238 ++--- ui/src/views/main/Content.tsx | 124 +-- ui/src/views/main/Header.tsx | 181 ++-- ui/src/views/main/LicenseWarningFooter.tsx | 81 +- ui/src/views/main/index.tsx | 230 +++-- ui/src/views/members/MemberList.tsx | 76 +- ui/src/views/members/index.tsx | 185 ++-- ui/src/views/repo/index.tsx | 260 +++--- ui/src/views/repoDeploy/DeployForm.tsx | 619 +++++++------ .../views/repoDeploy/DynamicPayloadModal.tsx | 225 ++--- ui/src/views/repoDeploy/StatusStateIcon.tsx | 182 ++-- ui/src/views/repoDeploy/index.tsx | 467 +++++----- ui/src/views/repoHome/ActivityLogs.tsx | 72 +- ui/src/views/repoHome/index.tsx | 222 ++--- ui/src/views/repoLock/LockList.tsx | 161 ++-- ui/src/views/repoLock/index.tsx | 185 ++-- ui/src/views/repoRollback/RollbackForm.tsx | 180 ++-- ui/src/views/repoRollback/index.tsx | 227 ++--- ui/src/views/repoSettings/SettingsForm.tsx | 147 ++- ui/src/views/repoSettings/index.tsx | 133 +-- ui/src/views/settings/SlackDescriptions.tsx | 36 +- ui/src/views/settings/UserDescriptions.tsx | 61 +- ui/src/views/settings/index.tsx | 96 +- ui/tsconfig.json | 10 +- 98 files changed, 7060 insertions(+), 6302 deletions(-) diff --git a/ui/.eslintrc.js b/ui/.eslintrc.js index 709d3e31..153c3fe3 100644 --- a/ui/.eslintrc.js +++ b/ui/.eslintrc.js @@ -1,16 +1,10 @@ module.exports = { - root: true, - parser: '@typescript-eslint/parser', - plugins: [ - '@typescript-eslint', - ], - extends: [ - 'eslint:recommended', - 'plugin:@typescript-eslint/recommended', - ], - rules: { - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-empty-interface": "off" - }, - }; - \ No newline at end of file + root: true, + parser: '@typescript-eslint/parser', + plugins: ['@typescript-eslint'], + extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'], + rules: { + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/no-empty-interface': 'off', + }, +}; diff --git a/ui/craco.config.js b/ui/craco.config.js index 165cb7e8..21767add 100644 --- a/ui/craco.config.js +++ b/ui/craco.config.js @@ -7,7 +7,7 @@ module.exports = { options: { lessLoaderOptions: { lessOptions: { - modifyVars: { + modifyVars: { // Custom theme // https://github.com/ant-design/ant-design/blob/master/components/style/themes/default.less // Colors @@ -17,8 +17,8 @@ module.exports = { // Layout '@layout-header-background': '@purple-10', '@layout-body-background': '#fff', - // - '@border-radius-base': '5px' + // + '@border-radius-base': '5px', }, javascriptEnabled: true, }, @@ -26,4 +26,4 @@ module.exports = { }, }, ], -}; \ No newline at end of file +}; diff --git a/ui/public/index.html b/ui/public/index.html index 4ce1a7dd..de165bf4 100644 --- a/ui/public/index.html +++ b/ui/public/index.html @@ -4,10 +4,7 @@ - +