mirror of
https://github.com/akvorado/akvorado.git
synced 2025-12-12 06:24:10 +01:00
console/frontend: update eslint
Also fix some of the reported problems, but delegate the "no-explicit-any" to later.
This commit is contained in:
@@ -1,22 +0,0 @@
|
|||||||
// SPDX-FileCopyrightText: 2022 Free Mobile
|
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
env: {
|
|
||||||
node: true,
|
|
||||||
"vue/setup-compiler-macros": true,
|
|
||||||
},
|
|
||||||
parserOptions: {
|
|
||||||
ecmaVersion: 2021,
|
|
||||||
},
|
|
||||||
extends: [
|
|
||||||
"plugin:vue/vue3-recommended",
|
|
||||||
"eslint:recommended",
|
|
||||||
"@vue/eslint-config-typescript",
|
|
||||||
"@vue/eslint-config-prettier",
|
|
||||||
],
|
|
||||||
rules: {
|
|
||||||
"vue/no-unused-vars": "error",
|
|
||||||
"vue/no-v-html": "off",
|
|
||||||
},
|
|
||||||
};
|
|
||||||
16
console/frontend/eslint.config.mjs
Normal file
16
console/frontend/eslint.config.mjs
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import pluginJs from "@eslint/js";
|
||||||
|
import pluginVue from "eslint-plugin-vue";
|
||||||
|
import vueTypescriptEslintConfig from "@vue/eslint-config-typescript";
|
||||||
|
import vuePrettierEslintConfig from "@vue/eslint-config-prettier";
|
||||||
|
|
||||||
|
export default [
|
||||||
|
{
|
||||||
|
languageOptions: {
|
||||||
|
ecmaVersion: 2021,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
pluginJs.configs.recommended,
|
||||||
|
...pluginVue.configs["flat/recommended"],
|
||||||
|
...vueTypescriptEslintConfig(),
|
||||||
|
vuePrettierEslintConfig,
|
||||||
|
];
|
||||||
8737
console/frontend/package-lock.json
generated
8737
console/frontend/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -38,6 +38,8 @@
|
|||||||
"vuedraggable": "^4.1.0"
|
"vuedraggable": "^4.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@eslint/eslintrc": "^3.2.0",
|
||||||
|
"@eslint/js": "^9.15.0",
|
||||||
"@headlessui/tailwindcss": "^0.2.0",
|
"@headlessui/tailwindcss": "^0.2.0",
|
||||||
"@tailwindcss/typography": "^0.5.2",
|
"@tailwindcss/typography": "^0.5.2",
|
||||||
"@tsconfig/node18": "^18.2.0",
|
"@tsconfig/node18": "^18.2.0",
|
||||||
@@ -46,15 +48,15 @@
|
|||||||
"@types/lz-string": "^1.3.34",
|
"@types/lz-string": "^1.3.34",
|
||||||
"@types/node": "^22.0.2",
|
"@types/node": "^22.0.2",
|
||||||
"@types/uuid": "^10.0.0",
|
"@types/uuid": "^10.0.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^7.9.0",
|
"@typescript-eslint/eslint-plugin": "^8.16.0",
|
||||||
"@vitejs/plugin-vue": "^5.0.3",
|
"@vitejs/plugin-vue": "^5.0.3",
|
||||||
"@vitest/coverage-v8": "^2.0.5",
|
"@vitest/coverage-v8": "^2.0.5",
|
||||||
"@volar/vue-language-server": "^1.0.9",
|
"@volar/vue-language-server": "^1.0.9",
|
||||||
"@vue/eslint-config-prettier": "^9.0.0",
|
"@vue/eslint-config-prettier": "^10.0.0",
|
||||||
"@vue/eslint-config-typescript": "^13.0.0",
|
"@vue/eslint-config-typescript": "^14.0.0",
|
||||||
"@vue/tsconfig": "^0.6.0",
|
"@vue/tsconfig": "^0.6.0",
|
||||||
"autoprefixer": "^10.4.7",
|
"autoprefixer": "^10.4.7",
|
||||||
"eslint": "^8.57.0",
|
"eslint": "^9.10.0",
|
||||||
"eslint-plugin-prettier": "^5.0.0",
|
"eslint-plugin-prettier": "^5.0.0",
|
||||||
"eslint-plugin-vue": "^9.2.0",
|
"eslint-plugin-vue": "^9.2.0",
|
||||||
"license-compliance": "^3.0.0",
|
"license-compliance": "^3.0.0",
|
||||||
|
|||||||
@@ -111,9 +111,11 @@ import InputBase from "@/components/InputBase.vue";
|
|||||||
|
|
||||||
const props = withDefaults(
|
const props = withDefaults(
|
||||||
defineProps<{
|
defineProps<{
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
modelValue: any; // vue is not smart enough to use any | any[]
|
modelValue: any; // vue is not smart enough to use any | any[]
|
||||||
multiple?: boolean;
|
multiple?: boolean;
|
||||||
filter?: string | null; // should be keyof items
|
filter?: string | null; // should be keyof items
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
items: Array<{ id: number; [n: string]: any }>;
|
items: Array<{ id: number; [n: string]: any }>;
|
||||||
error?: string;
|
error?: string;
|
||||||
}>(),
|
}>(),
|
||||||
@@ -157,7 +159,6 @@ const filteredItems = computed(() => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
const otherAttrs = computed(() => {
|
const otherAttrs = computed(() => {
|
||||||
// eslint-disable-next-line no-unused-vars
|
|
||||||
const { class: _, ...others } = attrs;
|
const { class: _, ...others } = attrs;
|
||||||
return others;
|
return others;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -63,10 +63,12 @@
|
|||||||
<strong>Unable to fetch documentation page!</strong>
|
<strong>Unable to fetch documentation page!</strong>
|
||||||
{{ errorMessage }}
|
{{ errorMessage }}
|
||||||
</InfoBox>
|
</InfoBox>
|
||||||
|
<!-- eslint-disable vue/no-v-html -->
|
||||||
<div
|
<div
|
||||||
class="prose-img:center prose prose-sm mx-auto dark:prose-invert md:prose-base prose-h1:border-b-2 prose-pre:whitespace-pre-wrap prose-pre:break-all prose-pre:rounded dark:prose-h1:border-gray-700"
|
class="prose-img:center prose prose-sm mx-auto dark:prose-invert md:prose-base prose-h1:border-b-2 prose-pre:whitespace-pre-wrap prose-pre:break-all prose-pre:rounded dark:prose-h1:border-gray-700"
|
||||||
v-html="markdown"
|
v-html="markdown"
|
||||||
></div>
|
></div>
|
||||||
|
<!-- eslint-enable -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -128,11 +128,13 @@ const encodedState = computed(() => encodeState(state.value));
|
|||||||
const fetchedData = ref<
|
const fetchedData = ref<
|
||||||
GraphLineHandlerResult | GraphSankeyHandlerResult | null
|
GraphLineHandlerResult | GraphSankeyHandlerResult | null
|
||||||
>(null);
|
>(null);
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
const orderedJSONPayload = <T extends Record<string, any>>(input: T): T => {
|
const orderedJSONPayload = <T extends Record<string, any>>(input: T): T => {
|
||||||
return Object.keys(input)
|
return Object.keys(input)
|
||||||
.sort()
|
.sort()
|
||||||
.reduce(
|
.reduce(
|
||||||
(o, k) => ((o[k] = input[k]), o),
|
(o, k) => ((o[k] = input[k]), o),
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
{} as { [key: string]: any },
|
{} as { [key: string]: any },
|
||||||
) as T;
|
) as T;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ const graph = computed((): ECOption => {
|
|||||||
// We will use a custom formatter, notably to handle bidirectional tooltips.
|
// We will use a custom formatter, notably to handle bidirectional tooltips.
|
||||||
if (!Array.isArray(params) || params.length === 0) return "";
|
if (!Array.isArray(params) || params.length === 0) return "";
|
||||||
|
|
||||||
let table: {
|
const table: {
|
||||||
key: string;
|
key: string;
|
||||||
seriesName: string;
|
seriesName: string;
|
||||||
marker: (typeof params)[0]["marker"];
|
marker: (typeof params)[0]["marker"];
|
||||||
@@ -332,20 +332,18 @@ const graph = computed((): ECOption => {
|
|||||||
.map((row, idx) => (row.some((name) => name === "Other") ? idx : -1))
|
.map((row, idx) => (row.some((name) => name === "Other") ? idx : -1))
|
||||||
.filter((idx) => idx >= 0),
|
.filter((idx) => idx >= 0),
|
||||||
somethingY = (fn: (...n: number[]) => number) =>
|
somethingY = (fn: (...n: number[]) => number) =>
|
||||||
fn.apply(
|
fn(
|
||||||
null,
|
...dataset.source.map((row) => {
|
||||||
dataset.source.map((row) => {
|
|
||||||
const [, ...cdr] = row;
|
const [, ...cdr] = row;
|
||||||
return fn.apply(
|
return fn(
|
||||||
null,
|
...cdr.filter((_, idx) => !otherIndexes.includes(idx + 1)),
|
||||||
cdr.filter((_, idx) => !otherIndexes.includes(idx + 1)),
|
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
maxY = somethingY(Math.max),
|
maxY = somethingY(Math.max),
|
||||||
minY = somethingY(Math.min);
|
minY = somethingY(Math.min);
|
||||||
let rowNumber = Math.ceil(Math.sqrt(uniqRows.length)),
|
let rowNumber = Math.ceil(Math.sqrt(uniqRows.length));
|
||||||
colNumber = rowNumber;
|
const colNumber = rowNumber;
|
||||||
if ((rowNumber - 1) * colNumber >= uniqRows.length) {
|
if ((rowNumber - 1) * colNumber >= uniqRows.length) {
|
||||||
rowNumber--;
|
rowNumber--;
|
||||||
}
|
}
|
||||||
@@ -391,7 +389,7 @@ const graph = computed((): ECOption => {
|
|||||||
dataset,
|
dataset,
|
||||||
series: data.rows
|
series: data.rows
|
||||||
.map((row, idx) => {
|
.map((row, idx) => {
|
||||||
let serie: LineSeriesOption = {
|
const serie: LineSeriesOption = {
|
||||||
type: "line",
|
type: "line",
|
||||||
symbol: "none",
|
symbol: "none",
|
||||||
xAxisIndex: uniqRowIndex(row),
|
xAxisIndex: uniqRowIndex(row),
|
||||||
|
|||||||
Reference in New Issue
Block a user