test hooks

This commit is contained in:
sunmeng 2025-04-07 15:27:42 +08:00
parent a60efa69bc
commit 5f47468cbf
4 changed files with 9 additions and 50 deletions

View File

@ -1,4 +0,0 @@
dist/
node_modules/
*.md
*.json

View File

@ -1,42 +0,0 @@
module.exports = {
// 标记为根配置文件ESLint 将停止在父目录中查找其他配置)
root: true,
// 指定代码运行环境
env: {
node: true, // Node.js 全局变量和作用域
es6: true // 启用 ES6 语法(不包括 ES6 全局变量,需要设置 parserOptions.ecmaVersion
},
// 继承的规则配置
extends: [
'eslint:recommended', // ESLint 官方推荐规则
'plugin:vue/vue3-recommended', // Vue 3 官方推荐规则
'plugin:@typescript-eslint/recommended', // TypeScript 推荐规则
'prettier' // 禁用与 Prettier 冲突的 ESLint 规则
],
// 指定 Vue 文件解析器
parser: 'vue-eslint-parser',
// 解析器选项
parserOptions: {
parser: '@typescript-eslint/parser', // 解析 TypeScript
sourceType: 'module', // 使用 ES 模块语法
ecmaVersion: 2020 // 支持 ES2020 语法
},
// 使用的插件
plugins: [
'vue', // Vue 语法支持
'@typescript-eslint', // TypeScript 支持
'prettier' // Prettier 集成
],
// 自定义规则配置
rules: {
'prettier/prettier': 'error', // 将 Prettier 的格式化问题报为错误
'vue/multi-word-component-names': 'off', // 关闭 Vue 组件多单词命名要求
'@typescript-eslint/no-explicit-any': 'off' // 允许使用 any 类型
}
};

9
eslint.config.js Normal file
View File

@ -0,0 +1,9 @@
module.exports = [
{
ignores: ['node_modules', 'dist'],
rules: {
'no-console': 'warn',
'no-debugger': 'error'
}
}
];

View File

@ -1,4 +0,0 @@
{
"navigationBarTitleText": "uni-app",
"usingComponents": {}
}