修复ESLint发现的问题:重复定义、无效代码
- recoveries-ui.js:删除较早的 recoveryCardRate(与后一份逐字相同,运行时生效的本就是后一份) - server.js:删除不可达的重复 GET /api/shop-settings 处理与重复的店主校验;删除从未被读取的初始值 - 订单取消/归属表单:去掉每个分支都会覆盖的变量初始值 - 去掉无效转义;测试夹具中的重复键保留实际生效的值 - 浏览器脚本的 no-unused-vars 只检查局部变量(顶层声明为跨文件全局名字) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ac143d73ce
commit
2b9cb825be
13 files changed
+12
-25
No files matched your search
@@ -51,6 +51,10 @@ module.exports = [
|
||||
{
|
||||
files: ['public/*.js'],
|
||||
languageOptions: { sourceType: 'script', globals: { ...globals.browser } },
|
||||
rules: {
|
||||
// 经典脚本的顶层声明是供其他脚本与页面事件使用的全局名字,单文件无法判断是否被用到;只检查局部变量。
|
||||
'no-unused-vars': ['warn', { args: 'none', vars: 'local' }],
|
||||
},
|
||||
},
|
||||
// 浏览器与服务端共用的 UMD 文件:仅在 typeof module 判断成立时使用 module/require。
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user