Compare commits

...

2 Commits

Author SHA1 Message Date
jianguo 953038723d Merge pull request 'feat(mock): 重构 mock 数据处理并添加用户相关 API' (#7) from develop into master
Reviewed-on: #7
2025-04-29 14:02:50 +08:00
Lexcubia 2005e8c11b build: 添加 ESLint 和 Prettier 配置文件
- 新增 .eslintrc.js 配置 ESLint 规则,包括 Vue、TypeScript 和 Prettier 插件
- 新增 .prettierrc 配置 Prettier 格式化规则
- 设置合适的代码风格和警告级别,以提高代码质量和一致性
2025-04-28 16:11:23 +08:00
2 changed files with 49 additions and 0 deletions

36
.eslintrc.js Normal file
View File

@ -0,0 +1,36 @@
module.exports = {
root: true,
env: {
node: true,
browser: true,
es2021: true
},
extends: [
'plugin:vue/vue3-recommended',
'eslint:recommended',
'@vue/typescript/recommended',
'@vue/prettier',
'@vue/prettier/@typescript-eslint'
],
parserOptions: {
ecmaVersion: 2021
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'vue/multi-word-component-names': 'off',
'vue/no-v-html': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
'prettier/prettier': [
'warn',
{
semi: false,
singleQuote: true,
printWidth: 300,
trailingComma: 'none',
arrowParens: 'avoid'
}
]
}
}

13
.prettierrc Normal file
View File

@ -0,0 +1,13 @@
{
"semi": false,
"singleQuote": true,
"printWidth": 300,
"trailingComma": "none",
"arrowParens": "avoid",
"endOfLine": "auto",
"tabWidth": 2,
"useTabs": false,
"bracketSpacing": true,
"jsxBracketSameLine": false,
"vueIndentScriptAndStyle": true
}