diff --git a/snowy-admin-web/.gitignore b/snowy-admin-web/.gitignore index f5ee3956..10bfe526 100644 --- a/snowy-admin-web/.gitignore +++ b/snowy-admin-web/.gitignore @@ -20,7 +20,7 @@ auto-imports.d.ts # Editor directories and files .idea -.vscode +# .vscode *.suo *.ntvs* *.njsproj diff --git a/snowy-admin-web/.prettierrc.json b/snowy-admin-web/.prettierrc.json new file mode 100644 index 00000000..008cf7f1 --- /dev/null +++ b/snowy-admin-web/.prettierrc.json @@ -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 +} \ No newline at end of file diff --git a/snowy-admin-web/.vscode/settings.json b/snowy-admin-web/.vscode/settings.json new file mode 100644 index 00000000..90e17e3e --- /dev/null +++ b/snowy-admin-web/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "prettier.configPath": ".prettierrc.json", // 指向根目录的配置文件 + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true +} diff --git a/snowy-admin-web/prettier.config.js b/snowy-admin-web/prettier.config.js deleted file mode 100644 index 3e2d12f2..00000000 --- a/snowy-admin-web/prettier.config.js +++ /dev/null @@ -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 -}