Skip to content

Commit 9f52ece

Browse files
committed
init(custom): init
0 parents  commit 9f52ece

23 files changed

+10278
-0
lines changed

.commitlintrc.cjs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
module.exports = {
2+
extends: ['@commitlint/config-conventional'],
3+
rules: {
4+
'type-enum': [
5+
2,
6+
'always',
7+
[
8+
'feat',
9+
'fix',
10+
'perf',
11+
'style',
12+
'docs',
13+
'test',
14+
'refactor',
15+
'build',
16+
'ci',
17+
'init',
18+
'chore',
19+
'revert',
20+
'wip',
21+
'workflow',
22+
'types',
23+
'release',
24+
],
25+
],
26+
'subject-case': [0],
27+
},
28+
}

.cz-config.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
module.exports = {
2+
types: [
3+
{ value: 'feat', name: '✨ feat: 新功能' },
4+
{ value: 'fix', name: '🐛 fix: 修复' },
5+
{ value: 'init', name: '🎉 Init: 初始化' },
6+
{ value: 'docs', name: '📝 docs: 文档变更' },
7+
{ value: 'style', name: '💄 style: 代码格式(不影响代码运行的变动)' },
8+
{
9+
value: 'refactor',
10+
name: '♻️ refactor: 重构(既不是增加feature,也不是修复bug)',
11+
},
12+
{ value: 'perf', name: '⚡️ perf: 性能优化' },
13+
{ value: 'test', name: '✅ test: 增加测试' },
14+
{ value: 'revert', name: '⏪️ Revert: 回退' },
15+
{ value: 'build', name: '🚀‍ build: 构建过程或辅助工具的变动' },
16+
{ value: 'ci', name: '👷 ci: CI 配置' },
17+
],
18+
// 消息步骤
19+
messages: {
20+
type: '请选择提交类型:',
21+
subject: '请简要描述提交(必填):',
22+
customScope: '请输入修改范围(可选):',
23+
body: '请输入详细描述(可选):',
24+
breaking: '列出任何BREAKING CHANGES(可选)',
25+
footer: '请输入要关闭的issue(可选):',
26+
confirmCommit: '确认使用以上信息提交吗?',
27+
},
28+
allowBreakingChanges: ['feat', 'fix'],
29+
skipQuestions: ['customScope'],
30+
subjectLimit: 72,
31+
}

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
root = true
2+
3+
[*] # 表示所有文件适用
4+
charset = utf-8 # 设置文件字符集为 utf-8
5+
indent_style = space # 缩进风格(tab | space)
6+
indent_size = 2 # 缩进大小
7+
end_of_line = lf # 控制换行类型(lf | cr | crlf)
8+
trim_trailing_whitespace = true # 去除行首的任意空白字符
9+
insert_final_newline = true # 始终在文件末尾插入一个新行
10+
11+
[*.md] # 表示仅 md 文件适用以下规则
12+
max_line_length = off # 关闭最大行长度限制
13+
trim_trailing_whitespace = false # 关闭末尾空格修剪

.eslintrc.cjs

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es2021: true,
5+
node: true,
6+
},
7+
extends: [
8+
'eslint:recommended',
9+
'plugin:vue/vue3-essential',
10+
// eslint-plugin-import 插件, @see https://www.npmjs.com/package/eslint-plugin-import
11+
'plugin:import/recommended',
12+
// eslint-config-airbnb-base 插件, tips: 本插件也可以替换成 eslint-config-standard
13+
'airbnb-base',
14+
// 1. 接入 prettier 的规则
15+
'prettier',
16+
'plugin:prettier/recommended',
17+
'vue-global-api',
18+
],
19+
overrides: [
20+
{
21+
env: {
22+
node: true,
23+
},
24+
files: ['.eslintrc.{js}'],
25+
parserOptions: {
26+
sourceType: 'script',
27+
},
28+
},
29+
],
30+
parserOptions: {
31+
ecmaVersion: 'latest',
32+
parser: '@babel/eslint-parser',
33+
sourceType: 'module',
34+
},
35+
plugins: [
36+
'@babel/eslint-parser',
37+
'vue',
38+
// 2. 加入 prettier 的 eslint 插件
39+
'prettier',
40+
// eslint-import-resolver-typescript 插件,@see https://www.npmjs.com/package/eslint-import-resolver-typescript
41+
'import',
42+
],
43+
rules: {
44+
// 3. 注意要加上这一句,开启 prettier 自动修复的功能
45+
'prettier/prettier': 'error',
46+
// turn on errors for missing imports
47+
'import/no-unresolved': 'off',
48+
// 对后缀的检测,否则 import 一个ts文件也会报错,需要手动添加'.ts', 增加了下面的配置后就不用了
49+
'import/extensions': [
50+
'error',
51+
'ignorePackages',
52+
{ js: 'never', jsx: 'never', ts: 'never', tsx: 'never' },
53+
],
54+
// 只允许1个默认导出,关闭,否则不能随意export xxx
55+
'import/prefer-default-export': ['off'],
56+
'no-console': ['off'],
57+
// 'no-unused-vars': ['off'],
58+
// '@typescript-eslint/no-unused-vars': ['off'],
59+
// 解决vite.config.ts报错问题
60+
'import/no-extraneous-dependencies': 'off',
61+
'no-plusplus': 'off',
62+
'no-shadow': 'off',
63+
'vue/multi-word-component-names': 'off',
64+
'@typescript-eslint/no-explicit-any': 'off',
65+
},
66+
// eslint-import-resolver-typescript 插件,@see https://www.npmjs.com/package/eslint-import-resolver-typescript
67+
settings: {
68+
'import/parsers': {
69+
'@typescript-eslint/parser': ['.ts', '.tsx'],
70+
},
71+
'import/resolver': {
72+
typescript: {},
73+
},
74+
},
75+
globals: {
76+
uni: true,
77+
UniApp: true,
78+
wx: true,
79+
WechatMiniprogram: true,
80+
getCurrentPages: true,
81+
UniHelper: true,
82+
Page: true,
83+
App: true,
84+
},
85+
}

.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
.DS_Store
12+
dist
13+
*.local
14+
15+
# Editor directories and files
16+
.idea
17+
*.suo
18+
*.ntvs*
19+
*.njsproj
20+
*.sln
21+
*.sw?

.husky/commit-msg

76 Bytes
Binary file not shown.

.husky/pre-commit

68 Bytes
Binary file not shown.

.prettierrc.cjs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
module.exports = {
2+
// 一行的字符数,如果超过会进行换行,默认为80,官方建议设100-120其中一个数
3+
printWidth: 100,
4+
// 一个tab代表几个空格数,默认就是2
5+
tabWidth: 2,
6+
// 启用tab取代空格符缩进,默认为false
7+
useTabs: false,
8+
// 行尾是否使用分号,默认为true(添加理由:更加容易复制添加数据,不用去管理尾行)
9+
semi: false,
10+
vueIndentScriptAndStyle: true,
11+
// 字符串是否使用单引号,默认为false,即使用双引号,建议设true,即单引号
12+
singleQuote: true,
13+
// 给对象里的属性名是否要加上引号,默认为as-needed,即根据需要决定,如果不加引号会报错则加,否则不加
14+
quoteProps: 'as-needed',
15+
// 是否使用尾逗号,有三个可选值"<none|es5|all>"
16+
trailingComma: 'none',
17+
// 在jsx里是否使用单引号,你看着办
18+
jsxSingleQuote: true,
19+
// 对象大括号直接是否有空格,默认为true,效果:{ foo: bar }
20+
bracketSpacing: true,
21+
proseWrap: 'never',
22+
htmlWhitespaceSensitivity: 'strict',
23+
endOfLine: 'auto',
24+
}

.stylelintrc.cjs

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
module.exports = {
2+
root: true,
3+
extends: [
4+
'stylelint-config-standard',
5+
'stylelint-config-standard-scss', // tips: 本插件也可以替换成 stylelint-config-recommended-scss
6+
'stylelint-config-recommended-vue/scss',
7+
'stylelint-config-html/vue',
8+
'stylelint-config-recess-order'
9+
],
10+
overrides: [
11+
// 扫描 .vue/html 文件中的<style>标签内的样式
12+
{
13+
files: ['**/*.{vue,html}'],
14+
customSyntax: 'postcss-html'
15+
},
16+
{
17+
files: ['**/*.{css,scss}'],
18+
customSyntax: 'postcss-scss'
19+
}
20+
],
21+
// 自定义规则
22+
rules: {
23+
// 允许 global 、export 、v-deep等伪类
24+
'selector-pseudo-class-no-unknown': [
25+
true,
26+
{
27+
ignorePseudoClasses: ['global', 'export', 'v-deep', 'deep']
28+
}
29+
],
30+
'unit-no-unknown': [
31+
true,
32+
{
33+
ignoreUnits: ['rpx']
34+
}
35+
],
36+
// 处理小程序page标签不认识的问题
37+
'selector-type-no-unknown': [
38+
true,
39+
{
40+
ignoreTypes: ['page']
41+
}
42+
],
43+
'comment-empty-line-before': 'never'
44+
}
45+
}

auto-imports.d.ts

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
/* eslint-disable */
2+
/* prettier-ignore */
3+
// @ts-nocheck
4+
// noinspection JSUnusedGlobalSymbols
5+
// Generated by unplugin-auto-import
6+
export {}
7+
declare global {
8+
const EffectScope: typeof import('vue')['EffectScope']
9+
const computed: typeof import('vue')['computed']
10+
const createApp: typeof import('vue')['createApp']
11+
const customRef: typeof import('vue')['customRef']
12+
const defineAsyncComponent: typeof import('vue')['defineAsyncComponent']
13+
const defineComponent: typeof import('vue')['defineComponent']
14+
const effectScope: typeof import('vue')['effectScope']
15+
const getCurrentInstance: typeof import('vue')['getCurrentInstance']
16+
const getCurrentScope: typeof import('vue')['getCurrentScope']
17+
const h: typeof import('vue')['h']
18+
const inject: typeof import('vue')['inject']
19+
const isProxy: typeof import('vue')['isProxy']
20+
const isReactive: typeof import('vue')['isReactive']
21+
const isReadonly: typeof import('vue')['isReadonly']
22+
const isRef: typeof import('vue')['isRef']
23+
const markRaw: typeof import('vue')['markRaw']
24+
const nextTick: typeof import('vue')['nextTick']
25+
const onActivated: typeof import('vue')['onActivated']
26+
const onAddToFavorites: typeof import('@dcloudio/uni-app')['onAddToFavorites']
27+
const onBackPress: typeof import('@dcloudio/uni-app')['onBackPress']
28+
const onBeforeMount: typeof import('vue')['onBeforeMount']
29+
const onBeforeUnmount: typeof import('vue')['onBeforeUnmount']
30+
const onBeforeUpdate: typeof import('vue')['onBeforeUpdate']
31+
const onDeactivated: typeof import('vue')['onDeactivated']
32+
const onError: typeof import('@dcloudio/uni-app')['onError']
33+
const onErrorCaptured: typeof import('vue')['onErrorCaptured']
34+
const onHide: typeof import('@dcloudio/uni-app')['onHide']
35+
const onLaunch: typeof import('@dcloudio/uni-app')['onLaunch']
36+
const onLoad: typeof import('@dcloudio/uni-app')['onLoad']
37+
const onMounted: typeof import('vue')['onMounted']
38+
const onNavigationBarButtonTap: typeof import('@dcloudio/uni-app')['onNavigationBarButtonTap']
39+
const onNavigationBarSearchInputChanged: typeof import('@dcloudio/uni-app')['onNavigationBarSearchInputChanged']
40+
const onNavigationBarSearchInputClicked: typeof import('@dcloudio/uni-app')['onNavigationBarSearchInputClicked']
41+
const onNavigationBarSearchInputConfirmed: typeof import('@dcloudio/uni-app')['onNavigationBarSearchInputConfirmed']
42+
const onNavigationBarSearchInputFocusChanged: typeof import('@dcloudio/uni-app')['onNavigationBarSearchInputFocusChanged']
43+
const onPageNotFound: typeof import('@dcloudio/uni-app')['onPageNotFound']
44+
const onPageScroll: typeof import('@dcloudio/uni-app')['onPageScroll']
45+
const onPullDownRefresh: typeof import('@dcloudio/uni-app')['onPullDownRefresh']
46+
const onReachBottom: typeof import('@dcloudio/uni-app')['onReachBottom']
47+
const onReady: typeof import('@dcloudio/uni-app')['onReady']
48+
const onRenderTracked: typeof import('vue')['onRenderTracked']
49+
const onRenderTriggered: typeof import('vue')['onRenderTriggered']
50+
const onResize: typeof import('@dcloudio/uni-app')['onResize']
51+
const onScopeDispose: typeof import('vue')['onScopeDispose']
52+
const onServerPrefetch: typeof import('vue')['onServerPrefetch']
53+
const onShareAppMessage: typeof import('@dcloudio/uni-app')['onShareAppMessage']
54+
const onShareTimeline: typeof import('@dcloudio/uni-app')['onShareTimeline']
55+
const onShow: typeof import('@dcloudio/uni-app')['onShow']
56+
const onTabItemTap: typeof import('@dcloudio/uni-app')['onTabItemTap']
57+
const onThemeChange: typeof import('@dcloudio/uni-app')['onThemeChange']
58+
const onUnhandledRejection: typeof import('@dcloudio/uni-app')['onUnhandledRejection']
59+
const onUnload: typeof import('@dcloudio/uni-app')['onUnload']
60+
const onUnmounted: typeof import('vue')['onUnmounted']
61+
const onUpdated: typeof import('vue')['onUpdated']
62+
const provide: typeof import('vue')['provide']
63+
const reactive: typeof import('vue')['reactive']
64+
const readonly: typeof import('vue')['readonly']
65+
const ref: typeof import('vue')['ref']
66+
const resolveComponent: typeof import('vue')['resolveComponent']
67+
const shallowReactive: typeof import('vue')['shallowReactive']
68+
const shallowReadonly: typeof import('vue')['shallowReadonly']
69+
const shallowRef: typeof import('vue')['shallowRef']
70+
const toRaw: typeof import('vue')['toRaw']
71+
const toRef: typeof import('vue')['toRef']
72+
const toRefs: typeof import('vue')['toRefs']
73+
const toValue: typeof import('vue')['toValue']
74+
const triggerRef: typeof import('vue')['triggerRef']
75+
const unref: typeof import('vue')['unref']
76+
const useAttrs: typeof import('vue')['useAttrs']
77+
const useCssModule: typeof import('vue')['useCssModule']
78+
const useCssVars: typeof import('vue')['useCssVars']
79+
const useSlots: typeof import('vue')['useSlots']
80+
const watch: typeof import('vue')['watch']
81+
const watchEffect: typeof import('vue')['watchEffect']
82+
const watchPostEffect: typeof import('vue')['watchPostEffect']
83+
const watchSyncEffect: typeof import('vue')['watchSyncEffect']
84+
}
85+
// for type re-export
86+
declare global {
87+
// @ts-ignore
88+
export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue'
89+
import('vue')
90+
}

0 commit comments

Comments
 (0)