chore(snowy-admin-web): 为项目新增统一代码格式化prettier,原有的是不会自动生效需要配置路径,现于.vscode新增preiiier路径。更新 .gitignore 并移除 Prettier 配置

- 更新 .gitignore 文件,将 .vscode 目录改为注释
- 删除 prettier.config.js 文件,移除 Prettier 格式化配置
pull/284/head
zengzhiyao 2025-09-16 11:05:22 +08:00
parent f22390ab55
commit 0fd74864f5
4 changed files with 23 additions and 41 deletions

View File

@ -20,7 +20,7 @@ auto-imports.d.ts
# Editor directories and files
.idea
.vscode
# .vscode
*.suo
*.ntvs*
*.njsproj

View File

@ -0,0 +1,17 @@
{
"printWidth": 120,
"tabWidth": 2,
"useTabs": true,
"semi": false,
"singleQuote": true,
"quoteProps": "as-needed",
"jsxSingleQuote": false,
"jsxBracketSameLine": true,
"trailingComma": "none",
"bracketSpacing": true,
"arrowParens": "always",
"htmlWhitespaceSensitivity": "css",
"endOfLine": "lf",
"vueIndentScriptAndStyle": true,
"singleAttributePerLine": false
}

5
snowy-admin-web/.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,5 @@
{
"prettier.configPath": ".prettierrc.json", //
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
}

View File

@ -1,40 +0,0 @@
/**
* Copyright [2022] [https://www.xiaonuo.vip]
* Snowy采用APACHE LICENSE 2.0开源协议您在使用过程中需要注意以下几点
* 1.请不要删除和修改根目录下的LICENSE文件
* 2.请不要删除和修改Snowy源码头部的版权声明
* 3.本项目代码可免费商业使用商业使用请保留源码和相关描述文件的项目出处作者声明等
* 4.分发源码时候请注明软件出处 https://www.xiaonuo.vip
* 5.不可二次分发开源参与同类竞品如有想法可联系团队xiaonuobase@qq.com商议合作
* 6.若您的项目无法满足以上几点需要更多功能代码获取Snowy商业授权许可请在官网购买授权地址为 https://www.xiaonuo.vip
*/
module.exports = {
// 一行最多 180 字符
printWidth: 120,
// 使用 2 个tab缩进
tabWidth: 2,
// 使用tab符缩进false为空格缩进
useTabs: true,
// 行尾需要分号
semi: false,
// 使用单引号
singleQuote: true,
// 对象的 key 仅在必要时用引号
quoteProps: 'as-needed',
// jsx 不使用单引号,而使用双引号
jsxSingleQuote: false,
// 末尾不需要逗号
trailingComma: 'none',
// 大括号内的首尾需要空格
bracketSpacing: true,
// jsx 标签的反尖括号不需要换行
jsxBracketSameLine: true,
// 箭头函数,只有一个参数的时候,也需要括号
arrowParens: 'always',
// 根据显示样式决定 html 要不要折行
htmlWhitespaceSensitivity: 'css',
// 换行符使用 lf
endOfLine: 'lf',
// 缩进js跟css
vueIndentScriptAndStyle: true
}