diff --git a/src/.eslintrc.json b/src/.eslintrc.json index 696eec2e..71881365 100644 --- a/src/.eslintrc.json +++ b/src/.eslintrc.json @@ -1,11 +1,11 @@ -{ - "extends": "athom", - "ignorePatterns": [ - "**/vendor/*.js" - ], - "rules": { - "consistent-return": "off", - "no-shadow": "off", - "max-len": "off" - } -} +{ + "extends": "athom", + "ignorePatterns": [ + "node_modules/**/*" + ], + "rules": { + "consistent-return": "off", + "no-shadow": "off", + "max-len": "off" + } +} diff --git a/src/config.js b/src/config.js index a67b7bf4..40b70ddf 100644 --- a/src/config.js +++ b/src/config.js @@ -1,7 +1,6 @@ 'use strict'; const { release } = require('./package.json'); -require('dotenv').config(); // development module.exports.RELEASE = release; module.exports.PORT = process.env.PORT || '51821'; diff --git a/webui/.eslintrc.cjs b/webui/.eslintrc.cjs index 6e85adf7..6e0747ed 100644 --- a/webui/.eslintrc.cjs +++ b/webui/.eslintrc.cjs @@ -5,6 +5,7 @@ module.exports = { es2021: true, }, extends: ['eslint:recommended', 'plugin:vue/vue3-recommended', 'prettier'], + ignorePatterns: ['dist/**/*', 'node_modules/**/*'], parser: 'vue-eslint-parser', // parserOptions: { // parser: '@typescript-eslint/parser', @@ -15,7 +16,5 @@ module.exports = { 'vue/no-v-html': 'off', 'vue/multi-word-component-names': 'off', 'prettier/prettier': ['error'], - 'vue/no-undef-components': ['error'], - 'vue/no-undef-properties': ['error'], }, }; diff --git a/webui/package.json b/webui/package.json index 9edf5518..7aa9bbd5 100644 --- a/webui/package.json +++ b/webui/package.json @@ -7,7 +7,8 @@ "dev": "vite --host", "build": "vite build", "build:watch": "vite build --watch", - "preview": "vite preview" + "preview": "vite preview", + "lint": "eslint ." }, "dependencies": { "apexcharts": "^3.48.0", diff --git a/webui/postcss.config.js b/webui/postcss.config.js index 2e7af2b7..2aa7205d 100644 --- a/webui/postcss.config.js +++ b/webui/postcss.config.js @@ -3,4 +3,4 @@ export default { tailwindcss: {}, autoprefixer: {}, }, -} +}; diff --git a/webui/src/composables/useBytes.js b/webui/src/composables/useBytes.js index 496613f1..b0b98aea 100644 --- a/webui/src/composables/useBytes.js +++ b/webui/src/composables/useBytes.js @@ -2,13 +2,9 @@ export function useBytes() { const bytes = (bytes, decimals, kib, maxunit) => { kib = kib || false; if (bytes === 0) return '0 B'; - if (Number.isNaN(parseFloat(bytes)) && !Number.isFinite(bytes)) - return 'NaN'; + if (Number.isNaN(parseFloat(bytes)) && !Number.isFinite(bytes)) return 'NaN'; const k = kib ? 1024 : 1000; - const dm = - decimals != null && !Number.isNaN(decimals) && decimals >= 0 - ? decimals - : 2; + const dm = decimals != null && !Number.isNaN(decimals) && decimals >= 0 ? decimals : 2; const sizes = kib ? ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB', 'BiB'] : ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB', 'BB']; diff --git a/webui/vite.config.js b/webui/vite.config.js index ee0e1756..5754506b 100644 --- a/webui/vite.config.js +++ b/webui/vite.config.js @@ -1,17 +1,15 @@ -import { fileURLToPath, URL } from 'node:url' +import { fileURLToPath, URL } from 'node:url'; -import { defineConfig } from 'vite' -import vue from '@vitejs/plugin-vue' +import { defineConfig } from 'vite'; +import vue from '@vitejs/plugin-vue'; // https://vitejs.dev/config/ export default defineConfig({ - plugins: [ - vue(), - ], + plugins: [vue()], resolve: { alias: { - '@': fileURLToPath(new URL('./src', import.meta.url)) - } + '@': fileURLToPath(new URL('./src', import.meta.url)), + }, }, build: { outDir: 'dist', @@ -23,4 +21,4 @@ export default defineConfig({ // } // } }, -}) +});