From fb0ec742f58986dfeb3f16acfdc9ff9a8c8813ca Mon Sep 17 00:00:00 2001 From: axolotle Date: Sat, 24 Feb 2024 17:54:16 +0100 Subject: [PATCH 1/6] chore: replace standard with prettier --- app/.eslintrc.js | 26 +++----------------------- app/.prettierignore | 1 + app/.prettierrc | 19 +++++++++++++++++++ app/package.json | 9 ++++++--- 4 files changed, 29 insertions(+), 26 deletions(-) create mode 100644 app/.prettierignore create mode 100644 app/.prettierrc diff --git a/app/.eslintrc.js b/app/.eslintrc.js index 3e4cbdce..c2b207aa 100644 --- a/app/.eslintrc.js +++ b/app/.eslintrc.js @@ -7,32 +7,12 @@ module.exports = { extends: [ 'plugin:vue/strongly-recommended', 'eslint:recommended', - 'standard' + 'plugin:prettier/recommended', ], rules: { - 'vue/max-attributes-per-line': [ - 'error', - { - singleline: 3, - multiline: 3 - } - ], - 'vue/multi-word-component-names': 'off', // FIXME this should be adressed at some point - 'no-console': 'warn', - 'template-curly-spacing': 'off', - camelcase: 'warn', - indent: 'off', - 'no-irregular-whitespace': 'off', 'no-unused-vars': [ 'warn', - { varsIgnorePattern: '^_', destructuredArrayIgnorePattern: '^_' } + { varsIgnorePattern: '^_', destructuredArrayIgnorePattern: '^_' }, ], - quotes: 'warn', - 'no-multiple-empty-lines': [ - 'error', - { - max: 2 - } - ] - } + }, } diff --git a/app/.prettierignore b/app/.prettierignore new file mode 100644 index 00000000..849ddff3 --- /dev/null +++ b/app/.prettierignore @@ -0,0 +1 @@ +dist/ diff --git a/app/.prettierrc b/app/.prettierrc new file mode 100644 index 00000000..ad7671ce --- /dev/null +++ b/app/.prettierrc @@ -0,0 +1,19 @@ +{ + "semi": false, + "tabWidth": 2, + "singleQuote": true, + "overrides": [ + { + "files": "**/*.json", + "options": { + "tabWidth": 4 + } + }, + { + "files": "./*.json", + "options": { + "tabWidth": 2 + } + } + ] +} diff --git a/app/package.json b/app/package.json index 6f6b06ad..9c044232 100644 --- a/app/package.json +++ b/app/package.json @@ -7,8 +7,10 @@ "scripts": { "dev": "vite", "build": "vite build", - "lint": "eslint --ext .js,.vue src", - "lint-fix": "lint --fix" + "lint:js": "eslint --ext \".ts,.vue,.cjs,.js\" --ignore-path ../.gitignore .", + "lint:prettier": "prettier --check .", + "lint": "npm run lint:js && npm run lint:prettier", + "lintfix": "prettier --write --list-different . && npm run lint:js --fix" }, "dependencies": { "@fontsource/fira-code": "^4.5.13", @@ -28,11 +30,12 @@ "@vitejs/plugin-vue2": "^2.2.0", "bootstrap": "^4.6.0", "eslint": "^8.36.0", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-prettier": "^5.1.3", "eslint-plugin-vue": "^9.10.0", "popper.js": "^1.16.0", "portal-vue": "^2.1.7", "sass": "^1.60.0", - "standard": "^17.0.0", "vite": "^4.2.1" }, "browserslist": [ From 4101310b89a2d8cd5c486a2244b1a992073da8e7 Mon Sep 17 00:00:00 2001 From: axolotle Date: Sat, 24 Feb 2024 18:25:12 +0100 Subject: [PATCH 2/6] chore: lint --- app/.eslintrc.js | 2 +- app/index.html | 45 +- app/src/App.vue | 88 +++- app/src/api/api.js | 102 ++-- app/src/api/errors.js | 37 +- app/src/api/handlers.js | 28 +- app/src/components/AdressInputSelect.vue | 22 +- app/src/components/CardCollapse.vue | 29 +- app/src/components/CardDeckFeed.vue | 37 +- app/src/components/ConfigPanel.vue | 44 +- app/src/components/ConfigPanels.vue | 18 +- app/src/components/LazyRenderer.vue | 76 +-- app/src/components/MessageListGroup.vue | 34 +- app/src/components/QueryHeader.vue | 57 +- app/src/components/RecursiveListGroup.vue | 34 +- app/src/components/RoutableTabs.vue | 11 +- app/src/components/globals/AbstractForm.vue | 26 +- app/src/components/globals/CardForm.vue | 26 +- app/src/components/globals/DescriptionRow.vue | 10 +- app/src/components/globals/ExplainWhat.vue | 26 +- app/src/components/globals/FormField.vue | 34 +- app/src/components/globals/ReadOnlyField.vue | 21 +- app/src/components/globals/TopBar.vue | 22 +- app/src/components/globals/ViewBase.vue | 38 +- app/src/components/globals/ViewSearch.vue | 23 +- app/src/components/globals/YAlert.vue | 8 +- app/src/components/globals/YBreadcrumb.vue | 10 +- app/src/components/globals/YCard.vue | 41 +- app/src/components/globals/YIcon.vue | 11 +- app/src/components/globals/YListGroupItem.vue | 33 +- app/src/components/globals/YSpinner.vue | 91 +++- .../globals/formItems/ButtonItem.vue | 11 +- .../globals/formItems/CheckboxItem.vue | 8 +- .../globals/formItems/DisplayTextItem.vue | 4 +- .../components/globals/formItems/FileItem.vue | 21 +- .../globals/formItems/InputItem.vue | 13 +- .../globals/formItems/MarkdownItem.vue | 4 +- .../globals/formItems/ReadOnlyAlertItem.vue | 22 +- .../globals/formItems/SelectItem.vue | 4 +- .../components/globals/formItems/TagsItem.vue | 9 +- .../globals/formItems/TagsSelectizeItem.vue | 93 ++-- .../globals/formItems/TextAreaItem.vue | 4 +- .../globals/skeletons/CardButtonsSkeleton.vue | 6 +- .../globals/skeletons/CardFormSkeleton.vue | 22 +- .../globals/skeletons/CardInfoSkeleton.vue | 4 +- .../globals/skeletons/CardListSkeleton.vue | 12 +- .../globals/skeletons/ListGroupSkeleton.vue | 4 +- app/src/helpers/commons.js | 39 +- app/src/helpers/data/tree.js | 28 +- app/src/helpers/filters/date.js | 18 +- app/src/helpers/filters/human.js | 14 +- .../helpers/validators/customValidators.js | 76 ++- app/src/helpers/validators/index.js | 2 +- app/src/helpers/yunohostArguments.js | 190 ++++--- app/src/i18n/helpers.js | 22 +- app/src/i18n/supportedLocales.js | 82 +-- app/src/main.js | 29 +- app/src/router/index.js | 6 +- app/src/router/routes.js | 152 +++--- app/src/scss/_functions-override.scss | 13 +- app/src/scss/_variables.scss | 67 ++- app/src/scss/font.scss | 3 +- app/src/scss/main.scss | 133 +++-- app/src/store/data.js | 220 +++++--- app/src/store/index.js | 4 +- app/src/store/info.js | 202 ++++--- app/src/store/settings.js | 60 ++- app/src/views/HomeView.vue | 14 +- app/src/views/LoginView.vue | 81 +-- app/src/views/PostInstall.vue | 124 +++-- app/src/views/_partials/DomainForm.vue | 131 +++-- app/src/views/_partials/ErrorDisplay.vue | 32 +- app/src/views/_partials/HistoryConsole.vue | 91 ++-- .../views/_partials/ReconnectingDisplay.vue | 34 +- app/src/views/_partials/ViewLockOverlay.vue | 22 +- app/src/views/_partials/WaitingDisplay.vue | 31 +- app/src/views/_partials/WarningDisplay.vue | 25 +- app/src/views/app/AppCatalog.vue | 256 ++++++--- app/src/views/app/AppInfo.vue | 495 ++++++++++++------ app/src/views/app/AppInstall.vue | 261 ++++++--- app/src/views/app/AppList.vue | 37 +- app/src/views/backup/BackupCreate.vue | 113 ++-- app/src/views/backup/BackupInfo.vue | 152 +++--- app/src/views/backup/BackupList.vue | 49 +- app/src/views/backup/BackupView.vue | 15 +- app/src/views/diagnosis/DiagnosisView.vue | 144 +++-- app/src/views/domain/DomainAdd.vue | 39 +- app/src/views/domain/DomainDns.vue | 243 +++++---- app/src/views/domain/DomainInfo.vue | 200 ++++--- app/src/views/domain/DomainList.vue | 44 +- app/src/views/group/GroupCreate.vue | 54 +- app/src/views/group/GroupList.vue | 219 +++++--- app/src/views/service/ServiceInfo.vue | 106 ++-- app/src/views/service/ServiceList.vue | 56 +- app/src/views/tool/ToolFirewall.vue | 224 +++++--- app/src/views/tool/ToolList.vue | 32 +- app/src/views/tool/ToolLog.vue | 95 ++-- app/src/views/tool/ToolLogs.vue | 21 +- app/src/views/tool/ToolMigrations.vue | 58 +- app/src/views/tool/ToolPower.vue | 39 +- app/src/views/tool/ToolSettings.vue | 67 ++- app/src/views/tool/ToolWebadmin.vue | 41 +- app/src/views/update/SystemUpdate.vue | 154 ++++-- app/src/views/user/UserCreate.vue | 125 +++-- app/src/views/user/UserEdit.vue | 181 ++++--- app/src/views/user/UserImport.vue | 66 ++- app/src/views/user/UserInfo.vue | 84 ++- app/src/views/user/UserList.vue | 38 +- app/vite.config.js | 42 +- 109 files changed, 4289 insertions(+), 2731 deletions(-) diff --git a/app/.eslintrc.js b/app/.eslintrc.js index c2b207aa..728ddd1a 100644 --- a/app/.eslintrc.js +++ b/app/.eslintrc.js @@ -2,7 +2,7 @@ module.exports = { root: true, env: { es2021: true, - node: true + node: true, }, extends: [ 'plugin:vue/strongly-recommended', diff --git a/app/index.html b/app/index.html index 6b2030d5..8db9df95 100644 --- a/app/index.html +++ b/app/index.html @@ -1,23 +1,26 @@ - + + + + + + + + + YunoHost Admin + - - - - - - - - YunoHost Admin - - - - -
- - - - \ No newline at end of file + + +
+ + + diff --git a/app/src/App.vue b/app/src/App.vue index 596427e4..b45efeb9 100644 --- a/app/src/App.vue +++ b/app/src/App.vue @@ -4,23 +4,22 @@
- YunoHost logo + YunoHost logo - YunoHost logo + YunoHost logo @@ -28,7 +27,9 @@