From bc3e4ac32fa8cd51d87107c16a43f1fbb83bab3a Mon Sep 17 00:00:00 2001 From: Robert Kossessa Date: Fri, 1 Mar 2024 23:03:09 +0100 Subject: [PATCH] UPD: Linting frenzy --- .eslintrc.cjs | 7 +- .vscode/extensions.json | 5 +- package.json | 1 + pnpm-lock.yaml | 14 ++ src/renderer/src/App.vue | 14 +- src/renderer/src/components/WIP.vue | 6 +- .../src/components/common/ConfigSection.vue | 50 ++-- .../src/components/common/HSVInput.vue | 219 +++++++++++------- .../src/components/common/PaletteInput.vue | 55 +++-- .../src/components/common/ScrambleText.vue | 63 +++-- .../src/components/common/SteppedSlider.vue | 69 +++--- .../src/components/common/TabSelect.vue | 29 +-- .../src/components/common/TabSelectButton.vue | 39 +++- .../src/components/config/ConfigPane.vue | 18 +- .../config/keys/KeyFeedbackConfig.vue | 44 ++-- .../components/config/keys/KeyLightConfig.vue | 8 +- .../config/keys/KeyMappingConfig.vue | 47 ++-- .../config/knob/KnobFeedbackConfig.vue | 44 ++-- .../config/knob/KnobLightConfig.vue | 10 +- .../config/knob/KnobMappingConfig.vue | 42 ++-- .../src/components/device/DeviceBar.vue | 74 +++--- .../src/components/device/DeviceKeys.vue | 25 +- .../src/components/device/DeviceLEDRing.vue | 26 ++- .../src/components/device/DevicePreview.vue | 82 ++++--- .../src/components/navbar/MenubarButton.vue | 4 +- src/renderer/src/components/navbar/Navbar.vue | 92 +++++--- .../src/components/profile/ProfileButton.vue | 179 ++++++++------ .../src/components/profile/ProfileConfig.vue | 52 +++-- .../src/components/profile/ProfileManager.vue | 111 +++++---- src/renderer/src/device.ts | 112 +++++---- 30 files changed, 912 insertions(+), 629 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index b462405..7051e73 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -2,16 +2,19 @@ require('@rushstack/eslint-patch/modern-module-resolution') module.exports = { + root: true, extends: [ 'eslint:recommended', 'plugin:vue/vue3-recommended', '@electron-toolkit', '@electron-toolkit/eslint-config-ts/eslint-recommended', '@vue/eslint-config-typescript/recommended', - '@vue/eslint-config-prettier' + '@vue/eslint-config-prettier', + 'plugin:tailwindcss/recommended' ], rules: { 'vue/require-default-prop': 'off', - 'vue/multi-word-component-names': 'off' + 'vue/multi-word-component-names': 'off', + 'tailwindcss/no-custom-classname': 'off' } } diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 940260d..e873336 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,3 +1,6 @@ { - "recommendations": ["dbaeumer.vscode-eslint"] + "recommendations": [ + "dbaeumer.vscode-eslint", + "Vue.vscode-typescript-vue-plugin" + ] } diff --git a/package.json b/package.json index 8de5fff..88a083a 100644 --- a/package.json +++ b/package.json @@ -55,6 +55,7 @@ "electron-builder": "^24.9.1", "electron-vite": "^2.0.0", "eslint": "^8.56.0", + "eslint-plugin-tailwindcss": "^3.14.3", "eslint-plugin-vue": "^9.20.1", "postcss": "^8.4.35", "prettier": "^3.2.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0908988..7f0ed31 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -103,6 +103,9 @@ devDependencies: eslint: specifier: ^8.56.0 version: 8.57.0 + eslint-plugin-tailwindcss: + specifier: ^3.14.3 + version: 3.14.3(tailwindcss@3.4.1) eslint-plugin-vue: specifier: ^9.20.1 version: 9.22.0(eslint@8.57.0) @@ -2457,6 +2460,17 @@ packages: synckit: 0.8.8 dev: true + /eslint-plugin-tailwindcss@3.14.3(tailwindcss@3.4.1): + resolution: {integrity: sha512-1MKT8CrVuqVJleHxb7ICHsF2QwO0G+VJ28athTtlcOkccp0qmwK7nCUa1C9paCZ+VVgQU4fonsjLz/wUxoMHJQ==} + engines: {node: '>=12.13.0'} + peerDependencies: + tailwindcss: ^3.4.0 + dependencies: + fast-glob: 3.3.2 + postcss: 8.4.35 + tailwindcss: 3.4.1 + dev: true + /eslint-plugin-vue@9.22.0(eslint@8.57.0): resolution: {integrity: sha512-7wCXv5zuVnBtZE/74z4yZ0CM8AjH6bk4MQGm7hZjUC2DBppKU5ioeOk5LGSg/s9a1ZJnIsdPLJpXnu1Rc+cVHg==} engines: {node: ^14.17.0 || >=16.0.0} diff --git a/src/renderer/src/App.vue b/src/renderer/src/App.vue index df3cce9..06d3de1 100644 --- a/src/renderer/src/App.vue +++ b/src/renderer/src/App.vue @@ -46,23 +46,23 @@ window.nanodevices.on_event('update', (evt, deviceid, data) => { window.nanodevices.list_devices().then((devs) => store.init_devices(devs))