Bump ESLint from unsported version to version 9
This commit is contained in:
parent
00a96fec4e
commit
f4b430071e
6 changed files with 377 additions and 507 deletions
|
|
@ -1,44 +0,0 @@
|
||||||
module.exports = {
|
|
||||||
root: true,
|
|
||||||
env: {
|
|
||||||
node: true,
|
|
||||||
es2021: true,
|
|
||||||
},
|
|
||||||
parser: "vue-eslint-parser",
|
|
||||||
parserOptions: {
|
|
||||||
parser: "@babel/eslint-parser",
|
|
||||||
requireConfigFile: false,
|
|
||||||
ecmaVersion: 2021,
|
|
||||||
sourceType: "module",
|
|
||||||
},
|
|
||||||
extends: ["plugin:vue/vue3-recommended", "eslint:recommended", "@vue/prettier"],
|
|
||||||
rules: {
|
|
||||||
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
|
|
||||||
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
|
|
||||||
|
|
||||||
"vue/no-deprecated-slot-attribute": "warn",
|
|
||||||
"vue/no-deprecated-v-on-native-modifier": "warn",
|
|
||||||
"vue/no-deprecated-dollar-listeners-api": "warn",
|
|
||||||
"vue/no-deprecated-destroyed-lifecycle": "warn",
|
|
||||||
"vue/no-deprecated-dollar-scopedslots-api": "warn",
|
|
||||||
"vue/no-deprecated-events-api": "warn",
|
|
||||||
"vue/no-deprecated-filter": "warn",
|
|
||||||
"vue/no-deprecated-functional-template": "warn",
|
|
||||||
"vue/no-deprecated-html-element-is": "warn",
|
|
||||||
"vue/no-deprecated-inline-template": "warn",
|
|
||||||
"vue/no-deprecated-props-default-this": "warn",
|
|
||||||
"vue/no-deprecated-scope-attribute": "warn",
|
|
||||||
"vue/no-deprecated-v-bind-sync": "warn",
|
|
||||||
"vue/no-deprecated-v-is": "warn",
|
|
||||||
"vue/no-lifecycle-after-await": "warn",
|
|
||||||
"vue/no-watch-after-await": "warn",
|
|
||||||
|
|
||||||
"vue/require-explicit-emits": "warn", // Require emits declaration
|
|
||||||
"vue/multi-word-component-names": "warn", // Component naming
|
|
||||||
"vue/no-v-for-template-key-on-child": "error", // Key placement
|
|
||||||
"vue/no-v-model-argument": "off", // Allow v-model arguments (Vue 3 feature)
|
|
||||||
|
|
||||||
"vue/no-unused-components": "warn",
|
|
||||||
"vue/no-unused-vars": "warn",
|
|
||||||
},
|
|
||||||
};
|
|
||||||
78
webapp/eslint.config.mjs
Normal file
78
webapp/eslint.config.mjs
Normal file
|
|
@ -0,0 +1,78 @@
|
||||||
|
import js from "@eslint/js";
|
||||||
|
import vue from "eslint-plugin-vue";
|
||||||
|
import vueParser from "vue-eslint-parser";
|
||||||
|
import babelParser from "@babel/eslint-parser";
|
||||||
|
import prettier from "eslint-config-prettier";
|
||||||
|
import globals from "globals";
|
||||||
|
|
||||||
|
const isProd = process.env.NODE_ENV === "production";
|
||||||
|
|
||||||
|
export default [
|
||||||
|
{
|
||||||
|
languageOptions: {
|
||||||
|
globals: {
|
||||||
|
...globals.node,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
js.configs.recommended,
|
||||||
|
|
||||||
|
...vue.configs["flat/recommended"],
|
||||||
|
|
||||||
|
prettier,
|
||||||
|
|
||||||
|
{
|
||||||
|
files: ["**/*.vue", "**/*.js"],
|
||||||
|
languageOptions: {
|
||||||
|
parser: vueParser,
|
||||||
|
parserOptions: {
|
||||||
|
parser: babelParser,
|
||||||
|
requireConfigFile: false,
|
||||||
|
ecmaVersion: 2021,
|
||||||
|
sourceType: "module",
|
||||||
|
},
|
||||||
|
ecmaVersion: 2021,
|
||||||
|
sourceType: "module",
|
||||||
|
globals: {
|
||||||
|
process: "readonly",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
plugins: {
|
||||||
|
vue,
|
||||||
|
},
|
||||||
|
|
||||||
|
rules: {
|
||||||
|
// Environment-based rules
|
||||||
|
"no-console": isProd ? "warn" : "off",
|
||||||
|
"no-debugger": isProd ? "warn" : "off",
|
||||||
|
|
||||||
|
// Vue deprecations
|
||||||
|
"vue/no-deprecated-slot-attribute": "warn",
|
||||||
|
"vue/no-deprecated-v-on-native-modifier": "warn",
|
||||||
|
"vue/no-deprecated-dollar-listeners-api": "warn",
|
||||||
|
"vue/no-deprecated-destroyed-lifecycle": "warn",
|
||||||
|
"vue/no-deprecated-dollar-scopedslots-api": "warn",
|
||||||
|
"vue/no-deprecated-events-api": "warn",
|
||||||
|
"vue/no-deprecated-filter": "warn",
|
||||||
|
"vue/no-deprecated-functional-template": "warn",
|
||||||
|
"vue/no-deprecated-html-element-is": "warn",
|
||||||
|
"vue/no-deprecated-inline-template": "warn",
|
||||||
|
"vue/no-deprecated-props-default-this": "warn",
|
||||||
|
"vue/no-deprecated-scope-attribute": "warn",
|
||||||
|
"vue/no-deprecated-v-bind-sync": "warn",
|
||||||
|
"vue/no-deprecated-v-is": "warn",
|
||||||
|
"vue/no-lifecycle-after-await": "warn",
|
||||||
|
"vue/no-watch-after-await": "warn",
|
||||||
|
|
||||||
|
// Vue best practices
|
||||||
|
"vue/require-explicit-emits": "warn",
|
||||||
|
"vue/multi-word-component-names": "warn",
|
||||||
|
"vue/no-v-for-template-key-on-child": "error",
|
||||||
|
"vue/no-v-model-argument": "off",
|
||||||
|
|
||||||
|
"vue/no-unused-components": "warn",
|
||||||
|
"vue/no-unused-vars": "warn",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
750
webapp/package-lock.json
generated
750
webapp/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -8,8 +8,8 @@
|
||||||
"gv": "genversion src/version.js",
|
"gv": "genversion src/version.js",
|
||||||
"serve": "vite serve --mode development",
|
"serve": "vite serve --mode development",
|
||||||
"build": "vite build --mode production",
|
"build": "vite build --mode production",
|
||||||
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --ignore-path .gitignore",
|
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --ignore-pattern .gitignore",
|
||||||
"lint:fix": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore"
|
"lint:fix": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-pattern .gitignore"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@vueuse/core": "^14.1.0",
|
"@vueuse/core": "^14.1.0",
|
||||||
|
|
@ -30,7 +30,7 @@
|
||||||
"@vue/eslint-config-prettier": "9.0.0",
|
"@vue/eslint-config-prettier": "9.0.0",
|
||||||
"autoprefixer": "^10.4.24",
|
"autoprefixer": "^10.4.24",
|
||||||
"core-js": "^3.46.0",
|
"core-js": "^3.46.0",
|
||||||
"eslint": "^8.57.0",
|
"eslint": "^9.39.2",
|
||||||
"eslint-plugin-prettier": "^5.1.0",
|
"eslint-plugin-prettier": "^5.1.0",
|
||||||
"eslint-plugin-vue": "^9.20.0",
|
"eslint-plugin-vue": "^9.20.0",
|
||||||
"less": "^4.5.1",
|
"less": "^4.5.1",
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ export default {
|
||||||
propertyDescription: function () {
|
propertyDescription: function () {
|
||||||
try {
|
try {
|
||||||
return this.thingDescription(this.thingName).properties[this.propertyName];
|
return this.thingDescription(this.thingName).properties[this.propertyName];
|
||||||
} catch (error) {
|
} catch {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ export default {
|
||||||
if (typeof data === "string") return data;
|
if (typeof data === "string") return data;
|
||||||
try {
|
try {
|
||||||
return JSON.stringify(data, null, 2);
|
return JSON.stringify(data, null, 2);
|
||||||
} catch (err) {
|
} catch {
|
||||||
return String(data);
|
return String(data);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -97,7 +97,7 @@ export default {
|
||||||
if (error.response.data.detail) {
|
if (error.response.data.detail) {
|
||||||
try {
|
try {
|
||||||
return error.response.data.detail[0].msg;
|
return error.response.data.detail[0].msg;
|
||||||
} catch (err) {
|
} catch {
|
||||||
return error.response.data.detail;
|
return error.response.data.detail;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue