mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2026-11-07 17:38:55 +08:00
- 新增 eslint.config.js(flat config, vue3-essential),移除废弃的 .eslintrc.js/.eslintignore(引用已废弃的 babel-eslint),package.json 增加 lint/lint:fix 脚本 - 清理 17 处调试 console.log;修复 24 处空 catch(15 处补 console.warn 业务提示,9 处加注释说明可安全忽略) - 修复存量 lint error:9 处 prop 默认值改为函数形式、3 处未使用组件、1 处 v-if/v-for 同级、1 处空 else - vue.config.js 生产环境 terser 开启 drop_console 兜底
35 lines
1.1 KiB
JavaScript
35 lines
1.1 KiB
JavaScript
const globals = require('globals')
|
||
const pluginVue = require('eslint-plugin-vue')
|
||
|
||
module.exports = [
|
||
{
|
||
ignores: [
|
||
'dist/**',
|
||
'node_modules/**',
|
||
'build/**',
|
||
'config/**',
|
||
'src/scripts/**', // 一次性迁移脚本,不参与 lint
|
||
],
|
||
},
|
||
...pluginVue.configs['flat/essential'],
|
||
{
|
||
files: ['src/**/*.{js,vue}'],
|
||
languageOptions: {
|
||
ecmaVersion: 'latest',
|
||
sourceType: 'module',
|
||
globals: {
|
||
...globals.browser,
|
||
},
|
||
},
|
||
rules: {
|
||
'no-console': ['warn', { allow: ['warn', 'error'] }],
|
||
'no-empty': ['error', { allowEmptyCatch: false }],
|
||
'vue/no-parsing-error': ['error', { 'x-invalid-end-tag': false }],
|
||
// 页面组件通过路由按文件路径引用,组件名不参与解析,存量单词组件名不再强制多词
|
||
'vue/multi-word-component-names': 'off',
|
||
// 存量代码大量使用与 HTML 保留名同名的组件(element-plus 图标 Search/View/Camera/Link 及全局注册的 empty/drawer 等),重命名成本高,暂不启用
|
||
'vue/no-reserved-component-names': 'off',
|
||
},
|
||
},
|
||
]
|