Files
lilishop-ui/seller/eslint.config.js
lifenlong 88fc1b0b2a refactor: 四端完成 Options API → script setup + vuex → pinia 迁移
- buyer(95) / seller(169) / im(53) / manager(280) 共 597 个组件全部从 Options API 转换为 <script setup>
- 四端 vuex 全部移除,状态管理统一迁移至 pinia 4(stores/ 目录)
- util.js 等基础设施去除 vm 首参依赖;全局属性($Message/$filters 等)在 script 内改为具名导入
- 被外部 ref 访问的公共组件均已补齐 defineExpose(清单见各端 MIGRATION-VUE3.md)
- 各端 eslint 启用 vue/component-api-style 防止新代码回退 Options API
- 四端 yarn build 全部通过;迁移约定与注意事项已更新至各端 MIGRATION-VUE3.md
2026-10-13 07:06:59 +08:00

68 lines
2.4 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const globals = require('globals')
const js = require('@eslint/js')
const pluginVue = require('eslint-plugin-vue')
module.exports = [
{
ignores: [
'dist/**',
'node_modules/**',
'public/**',
// tree-table 是 JSX 写的旧组件,全项目无引用,待删除,暂不纳入检查
'src/views/my-components/tree-table/**',
],
},
js.configs.recommended,
...pluginVue.configs['flat/essential'],
{
files: ['src/**/*.{js,vue}'],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
globals: {
...globals.browser,
// webpack 构建环境注入
require: 'readonly',
module: 'writable',
process: 'readonly',
// public/config.js 通过 <script> 注入,见 public/index.html
BASE: 'readonly',
// 高德地图 loader 动态注入
AMapUI: 'readonly',
},
},
rules: {
'no-unused-vars': ['warn', { args: 'none', caughtErrors: 'none', ignoreRestSiblings: true }],
'no-empty': ['warn', { allowEmptyCatch: true }],
'no-constant-condition': ['error', { checkLoops: false }],
'no-console': 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'warn',
'no-undef': 'error',
// 存量代码大量使用 ==,先告警,逐步治理
eqeqeq: ['warn', 'always', { null: 'ignore' }],
// 项目依赖 v-html 渲染服务端内容,由 xss 过滤兜底,不在此处拦截
'vue/no-v-html': 'off',
// 页面组件多为单词命名且被路由引用,改名成本高
'vue/multi-word-component-names': 'off',
'vue/no-reserved-component-names': 'off',
// 存量 49 处直接改 prop,先告警,逐步治理
'vue/no-mutating-props': 'warn',
// 全端已完成 Options API → <script setup> 迁移,防止新代码回退(tpl_* 装修模板的自定义选项普通 script 块等有意保留的除外,故用 warn)
'vue/component-api-style': ['warn', ['script-setup']],
},
},
{
// 根目录构建配置 + scripts 工具:CommonJS + Node
files: ['*.config.js', 'scripts/**/*.js'],
languageOptions: {
sourceType: 'commonjs',
globals: { ...globals.node },
},
rules: {
// scripts 下是一次性迁移脚本,已执行完毕,不做变量层面的约束
'no-unused-vars': 'off',
},
},
]