Merge branch 'eslint-9' into 'v3'
Bump ESLint from unsported version to version 9 See merge request openflexure/openflexure-microscope-server!489
This commit is contained in:
commit
89c5ea6886
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",
|
||||
"serve": "vite serve --mode development",
|
||||
"build": "vite build --mode production",
|
||||
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --ignore-path .gitignore",
|
||||
"lint:fix": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --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-pattern .gitignore"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vueuse/core": "^14.1.0",
|
||||
|
|
@ -30,7 +30,7 @@
|
|||
"@vue/eslint-config-prettier": "9.0.0",
|
||||
"autoprefixer": "^10.4.24",
|
||||
"core-js": "^3.46.0",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint": "^9.39.2",
|
||||
"eslint-plugin-prettier": "^5.1.0",
|
||||
"eslint-plugin-vue": "^9.20.0",
|
||||
"less": "^4.5.1",
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ export default {
|
|||
propertyDescription: function () {
|
||||
try {
|
||||
return this.thingDescription(this.thingName).properties[this.propertyName];
|
||||
} catch (error) {
|
||||
} catch {
|
||||
return undefined;
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ export default {
|
|||
if (typeof data === "string") return data;
|
||||
try {
|
||||
return JSON.stringify(data, null, 2);
|
||||
} catch (err) {
|
||||
} catch {
|
||||
return String(data);
|
||||
}
|
||||
},
|
||||
|
|
@ -97,7 +97,7 @@ export default {
|
|||
if (error.response.data.detail) {
|
||||
try {
|
||||
return error.response.data.detail[0].msg;
|
||||
} catch (err) {
|
||||
} catch {
|
||||
return error.response.data.detail;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue