From 24f01fb58fe144b086ef02acac9f4b3402b30b47 Mon Sep 17 00:00:00 2001 From: Hayden <64056131+hay-kot@users.noreply.github.com> Date: Fri, 9 Sep 2022 14:19:00 -0800 Subject: [PATCH] setup and run eslint --- frontend/.editorconfig | 2 +- frontend/.eslintrc.json | 42 + frontend/components/App/Header.vue | 12 +- frontend/components/Base/ActionsDivider.vue | 4 +- frontend/components/Base/Button.vue | 13 +- frontend/components/Base/Container.vue | 4 +- frontend/components/Base/Details.vue | 2 +- frontend/components/Base/Modal.vue | 4 +- frontend/components/Form/DatePicker.vue | 13 +- frontend/components/Form/Multiselect.vue | 7 +- frontend/components/Form/Select.vue | 4 +- frontend/components/Form/TextArea.vue | 11 +- frontend/components/Form/TextField.vue | 4 +- frontend/components/Item/Card.vue | 7 +- frontend/components/Item/CreateModal.vue | 12 +- frontend/components/Label/Chip.vue | 6 +- frontend/components/Label/CreateModal.vue | 8 +- frontend/components/Location/CreateModal.vue | 6 +- frontend/components/ModalConfirm.vue | 2 +- frontend/composables/use-confirm.ts | 4 +- frontend/composables/use-ids.ts | 60 +- frontend/composables/use-notifier.ts | 80 +- frontend/lib/api/classes/items.ts | 10 +- frontend/lib/api/classes/labels.ts | 10 +- frontend/lib/api/classes/locations.ts | 11 +- frontend/lib/api/user.ts | 2 +- frontend/lib/requests/requests.ts | 2 +- frontend/nuxt.config.ts | 2 +- frontend/package.json | 12 + frontend/pages/[...all].vue | 12 +- frontend/pages/home.vue | 10 +- frontend/pages/index.vue | 6 +- frontend/pages/item/[id]/edit.vue | 6 +- frontend/pages/item/[id]/index.vue | 10 +- frontend/pages/item/new.vue | 42 +- frontend/pages/label/[id].vue | 8 +- frontend/pages/location/[id].vue | 8 +- frontend/pnpm-lock.yaml | 1413 +++++++++++++++++- frontend/postcss.config.js | 2 +- frontend/stores/auth.ts | 2 +- frontend/tailwind.config.js | 6 +- frontend/test/config.ts | 7 +- frontend/test/vitest.config.ts | 4 +- 43 files changed, 1655 insertions(+), 237 deletions(-) create mode 100644 frontend/.eslintrc.json diff --git a/frontend/.editorconfig b/frontend/.editorconfig index 9554c73..c18f89d 100644 --- a/frontend/.editorconfig +++ b/frontend/.editorconfig @@ -8,5 +8,5 @@ insert_final_newline = true [*.{js,jsx,html,sass,vue,ts,tsx,json}] charset = utf-8 indent_style = tab -indent_size = 4 +indent_size = 2 trim_trailing_whitespace = true diff --git a/frontend/.eslintrc.json b/frontend/.eslintrc.json new file mode 100644 index 0000000..4ab1ef3 --- /dev/null +++ b/frontend/.eslintrc.json @@ -0,0 +1,42 @@ +{ + "env": { + "browser": true, + "es2021": true, + "node": true + }, + "extends": [ + "eslint:recommended", + "plugin:vue/essential", + "plugin:@typescript-eslint/recommended", + "@nuxtjs/eslint-config-typescript", + "plugin:vue/vue3-recommended", + "plugin:prettier/recommended" + ], + "parserOptions": { + "ecmaVersion": "latest", + "parser": "@typescript-eslint/parser", + "sourceType": "module" + }, + "plugins": ["vue", "@typescript-eslint"], + "rules": { + "vue/multi-word-component-names": "off", + "vue/no-setup-props-destructure": 0, + "vue/no-multiple-template-root": 0, + "no-console": 1, + "vue/no-v-model-argument": 0, + "@typescript-eslint/ban-ts-comment": 0, + "prettier/prettier": [ + "warn", + { + "arrowParens": "avoid", + "semi": true, + "tabWidth": 2, + "useTabs": false, + "vueIndentScriptAndStyle": true, + "singleQuote": true, + "trailingComma": "es5", + "printWidth": 120 + } + ] + } +} diff --git a/frontend/components/App/Header.vue b/frontend/components/App/Header.vue index 54d2e0f..199c76f 100644 --- a/frontend/components/App/Header.vue +++ b/frontend/components/App/Header.vue @@ -66,7 +66,7 @@
-