升级eslint

This commit is contained in:
xh
2026-01-17 02:44:08 +08:00
parent 569002c366
commit 76c576a6f7
10 changed files with 89 additions and 34 deletions
+46
View File
@@ -0,0 +1,46 @@
import js from '@eslint/js'
import globals from 'globals'
import tseslint from 'typescript-eslint'
import pluginVue from 'eslint-plugin-vue'
import json from '@eslint/json'
import css from '@eslint/css'
import { defineConfig } from 'eslint/config'
export default defineConfig([
{
files: ['**/*.{js,mjs,cjs,ts,mts,cts,vue}'],
plugins: { js },
extends: ['js/recommended'],
languageOptions: { globals: globals.browser }
},
tseslint.configs.recommended,
pluginVue.configs['flat/essential'],
{
files: ['**/*.vue'],
languageOptions: { parserOptions: { parser: tseslint.parser } },
rules: {
'vue/multi-word-component-names': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'no-empty': 'off'
}
},
{
files: ['**/*.json'],
plugins: { json },
language: 'json/json',
extends: ['json/recommended']
},
{
files: ['**/*.jsonc'],
plugins: { json },
language: 'json/jsonc',
extends: ['json/recommended']
},
{
files: ['**/*.json5'],
plugins: { json },
language: 'json/json5',
extends: ['json/recommended']
}
// { files: ['**/*.css'], plugins: { css }, language: 'css/css', extends: ['css/recommended'] }
])
+28 -24
View File
@@ -10,7 +10,7 @@
"preview": "vite preview --port 4173 --mode development",
"build:all": "node ./scripts/build.mjs",
"type-check": "vue-tsc --noEmit --checkJs true --skipLibCheck",
"lint": "eslint src --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts src --fix --ignore-path .gitignore",
"lint": "eslint src --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts src --fix",
"preinstall": "npx only-allow pnpm",
"outdated": "pnpm outdated"
},
@@ -21,7 +21,7 @@
"@highlightjs/vue-plugin": "^2.1.0",
"@logicflow/core": "^2.2.0",
"@logicflow/extension": "^2.2.0",
"@vueuse/core": "^13.5.0",
"@vueuse/core": "^14.1.0",
"@wangeditor/editor": "^5.1.23",
"@wangeditor/editor-for-vue": "^5.1.12",
"axios": "^1.13.2",
@@ -29,48 +29,52 @@
"css-color-function": "^1.3.3",
"dayjs": "^1.11.19",
"echarts": "^6.0.0",
"element-plus": "^2.12.0",
"element-plus": "^2.13.1",
"highlight.js": "^11.11.1",
"lodash-es": "^4.17.21",
"lodash-es": "^4.17.22",
"nprogress": "^0.2.0",
"pinia": "^3.0.3",
"query-string": "^9.2.2",
"spark-md5": "^3.0.2",
"vue": "^3.5.25",
"vue": "^3.5.26",
"vue-clipboard3": "^2.0.0",
"vue-router": "^4.5.1",
"vue-router": "^4.6.4",
"vue-virtual-scroller": "2.0.0-beta.8",
"vue3-video-play": "^1.3.2",
"vuedraggable": "^4.1.0",
"vxe-table": "^4.16.11"
"vxe-table": "^4.17.42"
},
"devDependencies": {
"@rushstack/eslint-patch": "^1.11.0",
"@eslint/css": "^0.14.1",
"@eslint/js": "^9.39.2",
"@eslint/json": "^0.14.0",
"@types/lodash-es": "^4.17.12",
"@types/node": "^22.14.1",
"@types/node": "^25.0.9",
"@types/nprogress": "^0.2.3",
"@vitejs/plugin-vue": "^6.0.2",
"@vitejs/plugin-vue-jsx": "^5.1.2",
"@vue/eslint-config-prettier": "^9.0.0",
"@vue/eslint-config-typescript": "^13.0.0",
"@vue/tsconfig": "^0.8.1",
"autoprefixer": "^10.4.22",
"eslint": "^8.57.0",
"eslint-plugin-vue": "^9.27.0",
"@vitejs/plugin-vue": "^6.0.3",
"@vitejs/plugin-vue-jsx": "^5.1.3",
"autoprefixer": "^10.4.23",
"eslint": "^9.39.2",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-vue": "^10.7.0",
"execa": "^9.5.2",
"fs-extra": "^11.3.0",
"fs-extra": "^11.3.3",
"globals": "^17.0.0",
"jiti": "^2.6.1",
"postcss": "^8.5.3",
"prettier": "^3.6.2",
"prettier": "^3.8.0",
"rollup-plugin-visualizer": "^6.0.3",
"sass": "^1.87.0",
"sass": "^1.97.2",
"tailwindcss": "^3.4.15",
"typescript": "~5.8.3",
"unplugin-auto-import": "^19.3.0",
"unplugin-vue-components": "^28.7.0",
"typescript": "~5.9.3",
"typescript-eslint": "^8.53.0",
"unplugin-auto-import": "^21.0.0",
"unplugin-vue-components": "^31.0.0",
"vite": "8.0.0-beta.0",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-style-import": "^2.0.0",
"vite-plugin-svg-icons": "^2.0.1",
"vue-tsc": "^3.0.6"
"vue-eslint-parser": "^10.2.0",
"vue-tsc": "^3.2.2"
}
}
@@ -1452,7 +1452,7 @@ export default defineComponent({
if (!data.activeRule || data.validateForm.api[data.activeRule._fc_id] !== data.activeRule) return;
methods.handleChange('', field, value, _, fapi);
data.dragForm.api.refreshValidate();
data.dragForm.api.nextTick(() => {
data.dragForm.api.nextTick()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(() => {
data.dragForm.api.clearValidateState(data.activeRule.__fc__.id);
});
},
@@ -1686,7 +1686,7 @@ export default defineComponent({
$required: formData.formCreate$required
};
data.dragForm.api.refreshValidate();
data.dragForm.api.nextTick(() => {
data.dragForm.api.nextTick()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(() => {
data.dragForm.api.clearValidateState(rule.__fc__.id);
});
}
@@ -13,6 +13,9 @@ defineProps({
default: true
}
})
defineOptions({
name: 'FooterBtns'
})
</script>
<style scoped lang="scss">
@@ -11,6 +11,9 @@ import 'highlight.js/styles/monokai.min.css'
import hljs from 'highlight.js/lib/common'
import javascript from 'highlight.js/lib/languages/javascript'
import go from 'highlight.js/lib/languages/go'
defineOptions({
name: 'HighlightCode'
})
hljs.registerLanguage('javascript', javascript)
hljs.registerLanguage('go', go)
@@ -7,6 +7,10 @@ import { computed } from 'vue'
import type { CSSProperties } from 'vue'
import { addUnit } from '@/utils/util'
import { imageProps } from 'element-plus'
defineOptions({
name: 'ImageContain'
})
const props = defineProps({
width: {
type: [String, Number],
+3
View File
@@ -113,6 +113,9 @@ import { ACCOUNT_KEY } from '@/enums/cacheEnums'
import { PageEnum } from '@/enums/pageEnum'
import { useLockFn } from '@/hooks/useLockFn'
import { encryptPassword } from '@/utils/util'
defineOptions({
name: 'AccountLogin'
})
const Verify = defineAsyncComponent(() => import('@/components/verify/Verify.vue'))
const ImageContain = defineAsyncComponent(() => import('@/components/image-contain/index.vue'))
// const verifyRef = ref(null)
-6
View File
@@ -334,12 +334,6 @@ const open = (type = 'add') => {
const setFormData = (data: Record<any, any>) => {
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
// if (key == 'perms') {
// formData['permsArr'] = data[key].split(',')
// } else {
// formData[key] = data[key]
// }
formData[key] = data[key]
}
}
-2
View File
@@ -98,12 +98,10 @@ const open = (type = 'add') => {
const setFormData = (data: Record<any, any>) => {
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
formData[key] = data[key]
}
//TODO:因为后端返回字段为is_stop
else {
//@ts-ignore
formData[key] = data['is_stop']
}
}