Skip to content

Commit 61ee52a

Browse files
committed
feat: init
0 parents  commit 61ee52a

30 files changed

+11479
-0
lines changed

.editorconfig

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
#缩进风格:空格
6+
indent_style = space
7+
#缩进大小2
8+
indent_size = 2
9+
#换行符lf
10+
end_of_line = lf
11+
#字符集utf-8
12+
charset = utf-8
13+
#是否删除行尾的空格
14+
trim_trailing_whitespace = true
15+
#是否在文件的最后插入一个空行
16+
insert_final_newline = true
17+
18+
[*.md]
19+
trim_trailing_whitespace = false
20+
21+
[Makefile]
22+
indent_style = tab

.eslintignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# eslint 忽略检查
2+
node_modules
3+
dist
4+
git-cz
5+
*.css
6+
*.less
7+
*.scss
8+
*.jpg
9+
*.png
10+
*.gif
11+
*.svg
12+
*.html
13+
*.d.ts

.eslintrc-auto-import.json

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"globals": {
3+
"computed": "readonly",
4+
"createApp": "readonly",
5+
"customRef": "readonly",
6+
"defineAsyncComponent": "readonly",
7+
"defineComponent": "readonly",
8+
"effectScope": "readonly",
9+
"EffectScope": "readonly",
10+
"getCurrentInstance": "readonly",
11+
"getCurrentScope": "readonly",
12+
"h": "readonly",
13+
"inject": "readonly",
14+
"isReadonly": "readonly",
15+
"isRef": "readonly",
16+
"markRaw": "readonly",
17+
"nextTick": "readonly",
18+
"onActivated": "readonly",
19+
"onBeforeMount": "readonly",
20+
"onBeforeUnmount": "readonly",
21+
"onBeforeUpdate": "readonly",
22+
"onDeactivated": "readonly",
23+
"onErrorCaptured": "readonly",
24+
"onMounted": "readonly",
25+
"onRenderTracked": "readonly",
26+
"onRenderTriggered": "readonly",
27+
"onScopeDispose": "readonly",
28+
"onServerPrefetch": "readonly",
29+
"onUnmounted": "readonly",
30+
"onUpdated": "readonly",
31+
"provide": "readonly",
32+
"reactive": "readonly",
33+
"readonly": "readonly",
34+
"ref": "readonly",
35+
"resolveComponent": "readonly",
36+
"shallowReactive": "readonly",
37+
"shallowReadonly": "readonly",
38+
"shallowRef": "readonly",
39+
"toRaw": "readonly",
40+
"toRef": "readonly",
41+
"toRefs": "readonly",
42+
"triggerRef": "readonly",
43+
"unref": "readonly",
44+
"useAttrs": "readonly",
45+
"useCssModule": "readonly",
46+
"useCssVars": "readonly",
47+
"useRoute": "readonly",
48+
"useRouter": "readonly",
49+
"useSlots": "readonly",
50+
"watch": "readonly",
51+
"watchEffect": "readonly"
52+
}
53+
}

.eslintrc.js

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
browser: true,
5+
node: true,
6+
es2021: true,
7+
},
8+
parser: 'vue-eslint-parser',
9+
extends: [
10+
'eslint:recommended',
11+
'plugin:vue/vue3-recommended',
12+
'plugin:@typescript-eslint/recommended',
13+
'plugin:prettier/recommended',
14+
// eslint-config-prettier 的缩写
15+
'prettier',
16+
'vue-global-api',
17+
'.eslintrc-auto-import.json',
18+
],
19+
parserOptions: {
20+
ecmaVersion: 12,
21+
parser: '@typescript-eslint/parser',
22+
sourceType: 'module',
23+
},
24+
// eslint-plugin-vue @typescript-eslint/eslint-plugin eslint-plugin-prettier的缩写
25+
plugins: ['vue', '@typescript-eslint', 'prettier', 'import', 'simple-import-sort'],
26+
rules: {
27+
'simple-import-sort/imports': 'error',
28+
'simple-import-sort/exports': 'error',
29+
'vue/no-multiple-template-root': 'off', // 解决template中最顶层只能返回一个元素的检测报错
30+
'import/no-unresolved': [
31+
// 解决无法识别问题
32+
2,
33+
{
34+
ignore: ['./'],
35+
},
36+
],
37+
'import/no-extraneous-dependencies': ['error', { devDependencies: true }], // 解决依赖问题
38+
'no-param-reassign': [
39+
// 解决不能直接修改参数问题
40+
'error',
41+
{
42+
props: true,
43+
ignorePropertyModificationsFor: ['request', 'res', 'response', 'state', 'config'],
44+
},
45+
],
46+
'@typescript-eslint/ban-ts-ignore': 'off',
47+
'@typescript-eslint/no-unused-vars': 'off',
48+
'@typescript-eslint/explicit-function-return-type': 'off',
49+
'@typescript-eslint/no-explicit-any': 'off',
50+
'@typescript-eslint/no-var-requires': 'off',
51+
'@typescript-eslint/no-empty-function': 'off',
52+
'@typescript-eslint/no-use-before-define': 'off',
53+
'@typescript-eslint/ban-ts-comment': 'off',
54+
'@typescript-eslint/ban-types': 'off',
55+
'@typescript-eslint/no-non-null-assertion': 'off',
56+
'@typescript-eslint/explicit-module-boundary-types': 'off',
57+
'no-var': 'error',
58+
'prettier/prettier': 'error',
59+
// 禁止出现console
60+
// "no-console": "warn",
61+
// 禁用debugger
62+
// "no-debugger": "warn",
63+
// 禁止出现重复的 case 标签
64+
'no-duplicate-case': 'warn',
65+
// 禁止出现空语句块
66+
'no-empty': 'warn',
67+
// 禁止不必要的括号
68+
'no-extra-parens': 'off',
69+
// 禁止对 function 声明重新赋值
70+
'no-func-assign': 'warn',
71+
// 禁止在 return、throw、continue 和 break 语句之后出现不可达代码
72+
'no-unreachable': 'warn',
73+
// 强制所有控制语句使用一致的括号风格
74+
// curly: 'warn',
75+
// 要求 switch 语句中有 default 分支
76+
'default-case': 'warn',
77+
// 强制尽可能地使用点号
78+
'dot-notation': 'warn',
79+
// 要求使用 === 和 !==
80+
eqeqeq: 'warn',
81+
// 禁止 if 语句中 return 语句之后有 else 块
82+
'no-else-return': 'warn',
83+
// 禁止出现空函数
84+
'no-empty-function': 'warn',
85+
// 禁用不必要的嵌套块
86+
'no-lone-blocks': 'warn',
87+
// 禁止使用多个空格
88+
'no-multi-spaces': 'warn',
89+
// 禁止多次声明同一变量
90+
'no-redeclare': 'off',
91+
'@typescript-eslint/no-redeclare': ['error'],
92+
// 禁止在 return 语句中使用赋值语句
93+
'no-return-assign': 'warn',
94+
// 禁用不必要的 return await
95+
'no-return-await': 'warn',
96+
// 禁止自我赋值
97+
'no-self-assign': 'warn',
98+
// 禁止自身比较
99+
'no-self-compare': 'warn',
100+
// 禁止不必要的 catch 子句
101+
'no-useless-catch': 'warn',
102+
// 禁止多余的 return 语句
103+
'no-useless-return': 'warn',
104+
// 禁止变量声明与外层作用域的变量同名
105+
'no-shadow': 'off',
106+
// 允许delete变量
107+
'no-delete-var': 'off',
108+
// 强制数组方括号中使用一致的空格
109+
'array-bracket-spacing': 'warn',
110+
// 强制在代码块中使用一致的大括号风格
111+
'brace-style': 'warn',
112+
// 强制使用骆驼拼写法命名约定
113+
// camelcase: 'warn',
114+
// 强制使用一致的缩进
115+
indent: 'off',
116+
// 强制可嵌套的块的最大深度4
117+
'max-depth': 'warn',
118+
// 强制最大行数 300
119+
// "max-lines": ["warn", { "max": 1200 }],
120+
// 强制函数最大代码行数 50
121+
// 'max-lines-per-function': ['warn', { max: 70 }],
122+
// 强制函数块最多允许的的语句数量20
123+
'max-statements': ['warn', 100],
124+
// 强制回调函数最大嵌套深度
125+
'max-nested-callbacks': ['warn', 3],
126+
// 强制函数定义中最多允许的参数数量
127+
'max-params': ['warn', 3],
128+
// 强制每一行中所允许的最大语句数量
129+
'max-statements-per-line': ['warn', { max: 1 }],
130+
// 要求方法链中每个调用都有一个换行符
131+
'newline-per-chained-call': ['warn', { ignoreChainWithDepth: 3 }],
132+
// 禁止 if 作为唯一的语句出现在 else 语句中
133+
'no-lonely-if': 'warn',
134+
// 禁止空格和 tab 的混合缩进
135+
'no-mixed-spaces-and-tabs': 'warn',
136+
// 禁止出现多行空行
137+
'no-multiple-empty-lines': 'warn',
138+
// 禁止出现;
139+
semi: ['warn', 'never'],
140+
// 强制在块之前使用一致的空格
141+
'space-before-blocks': 'warn',
142+
// 强制在 function的左括号之前使用一致的空格
143+
// 'space-before-function-paren': ['warn', 'never'],
144+
// 强制在圆括号内使用一致的空格
145+
'space-in-parens': 'warn',
146+
// 要求操作符周围有空格
147+
'space-infix-ops': 'warn',
148+
// 强制在一元操作符前后使用一致的空格
149+
'space-unary-ops': 'warn',
150+
// 强制在注释中 // 或 /* 使用一致的空格
151+
// "spaced-comment": "warn",
152+
// 强制在 switch 的冒号左右有空格
153+
'switch-colon-spacing': 'warn',
154+
// 强制箭头函数的箭头前后使用一致的空格
155+
'arrow-spacing': 'warn',
156+
'prefer-const': 'warn',
157+
'prefer-rest-params': 'warn',
158+
'no-useless-escape': 'warn',
159+
'no-irregular-whitespace': 'warn',
160+
'no-prototype-builtins': 'warn',
161+
'no-fallthrough': 'warn',
162+
'no-extra-boolean-cast': 'warn',
163+
'no-case-declarations': 'warn',
164+
'no-async-promise-executor': 'warn',
165+
},
166+
}

.gitignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.idea
17+
.DS_Store
18+
*.suo
19+
*.ntvs*
20+
*.njsproj
21+
*.sln
22+
*.sw?

.npmrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
engine-strict = true
2+
3+
registry = https://registry.npmjs.org/

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# 忽略格式化文件
2+
node_modules
3+
dist

0 commit comments

Comments
 (0)