Skip to content

Commit e9d3aba

Browse files
authored
新增mockjs,添加eslint和prettier的格式化配置,保持格式统一,修改权限相关三个页面的风格 (pixiu-io#83)
* 新增mockjs,添加eslint和prettier的格式化配置,保持格式统一,修改权限相关三个页面的风格 * 提交新配置
1 parent 2df0fca commit e9d3aba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+3284
-1614
lines changed

.eslintrc.js

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
browser: true,
5+
es2021: true,
6+
node: true,
7+
},
8+
extends: ['plugin:vue/vue3-recommended', 'plugin:prettier/recommended'],
9+
parserOptions: {
10+
ecmaVersion: 'latest',
11+
sourceType: 'module',
12+
ecmaFeatures: {
13+
jsx: true,
14+
tsx: true,
15+
},
16+
},
17+
rules: {
18+
'vue/multi-word-component-names': 'off',
19+
},
20+
};

.prettierrc.js

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
module.exports = {
2+
// 一行最多 100 字符
3+
printWidth: 100,
4+
// 使用 2 个空格缩进
5+
tabWidth: 2,
6+
// 不使用缩进符,而使用空格
7+
useTabs: false,
8+
// 行尾需要有分号
9+
semi: true,
10+
// 使用单引号
11+
singleQuote: true,
12+
// 对象的 key 仅在必要时用引号
13+
quoteProps: 'as-needed',
14+
// jsx 不使用单引号,而使用双引号
15+
jsxSingleQuote: false,
16+
// 末尾不需要逗号
17+
trailingComma: 'all',
18+
// 大括号内的首尾需要空格
19+
bracketSpacing: true,
20+
// jsx 标签的反尖括号需要换行
21+
bracketSameLine: false,
22+
// 箭头函数,只有一个参数的时候,也需要括号
23+
arrowParens: 'always',
24+
// 每个文件格式化的范围是文件的全部内容
25+
rangeStart: 0,
26+
rangeEnd: Infinity,
27+
// 不需要写文件开头的 @prettier
28+
requirePragma: false,
29+
// 不需要自动在文件开头插入 @prettier
30+
insertPragma: false,
31+
// 使用默认的折行标准
32+
proseWrap: 'preserve',
33+
// 根据显示样式决定 html 要不要折行
34+
htmlWhitespaceSensitivity: 'css',
35+
// 换行符使用 lf
36+
endOfLine: 'auto',
37+
};

env/.env.dev

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
NODE_ENV='development'
22

3-
VITE_BASE_API="http://localhost:8090"
3+
VITE_BASE_API="http://localhost:8080"

mock/login.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
export default [
2+
{
3+
url: '/users/login',
4+
method: 'POST',
5+
response: (options) => ({
6+
code: 200,
7+
token: '12313',
8+
}),
9+
},
10+
];

0 commit comments

Comments
 (0)