build: 优化 eslint 对于 no-empty 的宽松提醒 (#2919)

This commit is contained in:
贤心
2025-11-07 11:49:21 +08:00
committed by GitHub
parent 7f64eadef0
commit f48e8870e3
3 changed files with 7 additions and 22 deletions

View File

@@ -1,12 +0,0 @@
### 说明
- 版本: 在此处填写您所使用的 Layui 版本号(必填)
- 描述: 在此处填写详细的问题描述和具体的操作步骤(必填)
### 代码
在此处填写与本次 Issue 相关的业务代码(可选)
### 补充
在此处提供其他补充,如截图等信息(可选)

View File

@@ -1,8 +0,0 @@
blank_issues_enabled: false
contact_links:
- name: 😄 创建议题
url: https://github.com/layui/layui/issues/new?template=bug-feature.yml
about: 为了加强 Issue 规范、提升沟通效率Layui Issues 已统一在 Github 受理
- name: 📄 官方文档
url: https://layui.dev/
about: 建议在创建 Issue 之前,仔细查阅 Layui 开发文档,以便对其有更深入的了解,和更好地分析问题。

View File

@@ -13,7 +13,9 @@ export default defineConfig([
// Browser
{
files: ['src/**/*.js'],
plugins: { js },
plugins: {
js,
},
extends: ['js/recommended'],
languageOptions: {
ecmaVersion: 'latest',
@@ -22,9 +24,12 @@ export default defineConfig([
},
rules: {
'no-console': ['error', { allow: ['warn', 'error'] }], // 仅允许 warn 和 error
'no-unused-vars': 'warn', // 因 v2 这类代码较多,此处只做提醒
// 有时未完成代码,只做提醒
'no-unused-vars': 'warn', // 未使用变量/函数/参数
'no-empty': 'warn', // 空代码块
},
},
// Node
{
files: [