Skip to content

Commit 5e53d99

Browse files
committed
init: 模板初始化
0 parents  commit 5e53d99

Some content is hidden

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

54 files changed

+7135
-0
lines changed

.commitlintrc.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
extends: ['@commitlint/config-conventional'],
3+
rules: {
4+
'type-enum': [
5+
2,
6+
'always',
7+
['init', 'build', 'ci', 'chore', 'docs', 'feat', 'fix', 'perf', 'refactor', 'revert', 'style', 'test'],
8+
],
9+
},
10+
};

.editorconfig

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
[*] # 表示所有文件都要遵循
7+
indent_style = space # 缩进风格,可选配置有space和tab
8+
indent_size = 2 # 缩进大小
9+
end_of_line = lf # 换行符,可选配置有lf、cr和crlf
10+
charset = utf-8 # 编码格式,通常都是选utf-8
11+
trim_trailing_whitespace = true # 去除多余的空格
12+
insert_final_newline = true # 在尾部插入一行
13+
14+
[*.md] # 表示仅 md 文件适用
15+
insert_final_newline = false # 在尾部插入一行
16+
trim_trailing_whitespace = false # 去除多余的空格

.env

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
VITE_API_BASEURL = /api
2+
3+
VITE_BASE = /base-vue3/
4+
5+
VITE_APP_TITLE = base-vue3
6+

.env.development

Whitespace-only changes.

.env.production

Whitespace-only changes.

.eslintignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules
2+
.DS_Store
3+
dist
4+
dist-ssr
5+
*.local
6+
presets

.eslintrc-auto-import.json

+220
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,220 @@
1+
{
2+
"globals": {
3+
"acceptHMRUpdate": true,
4+
"asyncComputed": true,
5+
"autoResetRef": true,
6+
"biSyncRef": true,
7+
"computed": true,
8+
"computedInject": true,
9+
"controlledComputed": true,
10+
"controlledRef": true,
11+
"createApp": true,
12+
"createEventHook": true,
13+
"createGlobalState": true,
14+
"createPinia": true,
15+
"createReactiveFn": true,
16+
"createSharedComposable": true,
17+
"createUnrefFn": true,
18+
"customRef": true,
19+
"debouncedRef": true,
20+
"debouncedWatch": true,
21+
"defineAsyncComponent": true,
22+
"defineComponent": true,
23+
"defineStore": true,
24+
"eagerComputed": true,
25+
"effectScope": true,
26+
"EffectScope": true,
27+
"ElMessage": true,
28+
"extendRef": true,
29+
"getActivePinia": true,
30+
"getCurrentInstance": true,
31+
"getCurrentScope": true,
32+
"h": true,
33+
"ignorableWatch": true,
34+
"inject": true,
35+
"isDefined": true,
36+
"isReadonly": true,
37+
"isRef": true,
38+
"makeDestructurable": true,
39+
"mapActions": true,
40+
"mapGetters": true,
41+
"mapState": true,
42+
"mapStores": true,
43+
"mapWritableState": true,
44+
"markRaw": true,
45+
"nextTick": true,
46+
"onActivated": true,
47+
"onBeforeMount": true,
48+
"onBeforeUnmount": true,
49+
"onBeforeUpdate": true,
50+
"onClickOutside": true,
51+
"onDeactivated": true,
52+
"onErrorCaptured": true,
53+
"onKeyStroke": true,
54+
"onMounted": true,
55+
"onRenderTracked": true,
56+
"onRenderTriggered": true,
57+
"onScopeDispose": true,
58+
"onServerPrefetch": true,
59+
"onStartTyping": true,
60+
"onUnmounted": true,
61+
"onUpdated": true,
62+
"pausableWatch": true,
63+
"provide": true,
64+
"reactify": true,
65+
"reactifyObject": true,
66+
"reactive": true,
67+
"reactivePick": true,
68+
"readonly": true,
69+
"ref": true,
70+
"refDefault": true,
71+
"resolveComponent": true,
72+
"setActivePinia": true,
73+
"setMapStoreSuffix": true,
74+
"shallowReactive": true,
75+
"shallowReadonly": true,
76+
"shallowRef": true,
77+
"storeToRefs": true,
78+
"syncRef": true,
79+
"templateRef": true,
80+
"throttledRef": true,
81+
"throttledWatch": true,
82+
"toRaw": true,
83+
"toReactive": true,
84+
"toRef": true,
85+
"toRefs": true,
86+
"triggerRef": true,
87+
"tryOnBeforeUnmount": true,
88+
"tryOnMounted": true,
89+
"tryOnScopeDispose": true,
90+
"tryOnUnmounted": true,
91+
"unref": true,
92+
"unrefElement": true,
93+
"until": true,
94+
"useActiveElement": true,
95+
"useAsyncQueue": true,
96+
"useAsyncState": true,
97+
"useAttrs": true,
98+
"useBase64": true,
99+
"useBattery": true,
100+
"useBreakpoints": true,
101+
"useBroadcastChannel": true,
102+
"useBrowserLocation": true,
103+
"useClamp": true,
104+
"useClipboard": true,
105+
"useColorMode": true,
106+
"useConfirmDialog": true,
107+
"useCounter": true,
108+
"useCssModule": true,
109+
"useCssVar": true,
110+
"useCssVars": true,
111+
"useCycleList": true,
112+
"useDark": true,
113+
"useDebounce": true,
114+
"useDebouncedRefHistory": true,
115+
"useDebounceFn": true,
116+
"useDeviceMotion": true,
117+
"useDeviceOrientation": true,
118+
"useDevicePixelRatio": true,
119+
"useDevicesList": true,
120+
"useDisplayMedia": true,
121+
"useDocumentVisibility": true,
122+
"useDraggable": true,
123+
"useElementBounding": true,
124+
"useElementByPoint": true,
125+
"useElementHover": true,
126+
"useElementSize": true,
127+
"useElementVisibility": true,
128+
"useEventBus": true,
129+
"useEventListener": true,
130+
"useEventSource": true,
131+
"useEyeDropper": true,
132+
"useFavicon": true,
133+
"useFetch": true,
134+
"useFocus": true,
135+
"useFocusWithin": true,
136+
"useFps": true,
137+
"useFullscreen": true,
138+
"useGeolocation": true,
139+
"useIdle": true,
140+
"useIntersectionObserver": true,
141+
"useInterval": true,
142+
"useIntervalFn": true,
143+
"useKeyModifier": true,
144+
"useLastChanged": true,
145+
"useLocalStorage": true,
146+
"useMagicKeys": true,
147+
"useManualRefHistory": true,
148+
"useMediaControls": true,
149+
"useMediaQuery": true,
150+
"useMemoize": true,
151+
"useMemory": true,
152+
"useMounted": true,
153+
"useMouse": true,
154+
"useMouseInElement": true,
155+
"useMousePressed": true,
156+
"useMutationObserver": true,
157+
"useNavigatorLanguage": true,
158+
"useNetwork": true,
159+
"useNow": true,
160+
"useOnline": true,
161+
"usePageLeave": true,
162+
"useParallax": true,
163+
"usePermission": true,
164+
"usePointer": true,
165+
"usePointerSwipe": true,
166+
"usePreferredColorScheme": true,
167+
"usePreferredDark": true,
168+
"usePreferredLanguages": true,
169+
"useRafFn": true,
170+
"useRefHistory": true,
171+
"useResizeObserver": true,
172+
"useRoute": true,
173+
"useRouter": true,
174+
"useScreenSafeArea": true,
175+
"useScriptTag": true,
176+
"useScroll": true,
177+
"useScrollLock": true,
178+
"useSessionStorage": true,
179+
"useShare": true,
180+
"useSlots": true,
181+
"useSpeechRecognition": true,
182+
"useSpeechSynthesis": true,
183+
"useStorage": true,
184+
"useStorageAsync": true,
185+
"useStyleTag": true,
186+
"useSwipe": true,
187+
"useTemplateRefsList": true,
188+
"useTextSelection": true,
189+
"useThrottle": true,
190+
"useThrottledRefHistory": true,
191+
"useThrottleFn": true,
192+
"useTimeAgo": true,
193+
"useTimeout": true,
194+
"useTimeoutFn": true,
195+
"useTimestamp": true,
196+
"useTitle": true,
197+
"useToggle": true,
198+
"useTransition": true,
199+
"useUrlSearchParams": true,
200+
"useUserMedia": true,
201+
"useVibrate": true,
202+
"useVirtualList": true,
203+
"useVModel": true,
204+
"useVModels": true,
205+
"useWakeLock": true,
206+
"useWebNotification": true,
207+
"useWebSocket": true,
208+
"useWebWorker": true,
209+
"useWebWorkerFn": true,
210+
"useWindowFocus": true,
211+
"useWindowScroll": true,
212+
"useWindowSize": true,
213+
"watch": true,
214+
"watchAtMost": true,
215+
"watchEffect": true,
216+
"watchOnce": true,
217+
"watchWithFilter": true,
218+
"whenever": true
219+
}
220+
}

.eslintrc.js

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es2021: true,
5+
node: true,
6+
},
7+
globals: {
8+
defineEmits: true,
9+
document: true,
10+
localStorage: true,
11+
GLOBAL_VAR: true,
12+
window: true,
13+
defineProps: true,
14+
defineExpose: true,
15+
},
16+
extends: [
17+
'./.eslintrc-auto-import.json',
18+
'airbnb-base',
19+
'plugin:@typescript-eslint/recommended',
20+
'plugin:vue/vue3-recommended',
21+
'plugin:prettier/recommended', // 添加 prettier 插件
22+
],
23+
parserOptions: {
24+
ecmaVersion: 'latest',
25+
parser: '@typescript-eslint/parser',
26+
sourceType: 'module',
27+
},
28+
plugins: ['vue', '@typescript-eslint', 'import'],
29+
rules: {
30+
'no-console': 'off',
31+
'import/no-unresolved': 'off',
32+
'import/extensions': 'off',
33+
'import/no-extraneous-dependencies': 'off',
34+
},
35+
};

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
.DS_Store
3+
dist
4+
dist-ssr
5+
*.local

.husky/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

.husky/commit-msg

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx --no-install commitlint --edit $1

.husky/pre-commit

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx lint-staged

.prettierignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
.DS_Store
3+
dist
4+
dist-ssr
5+
*.local

.vscode/extensions.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"recommendations": [
3+
"johnsoncodehk.volar",
4+
"voorjaar.windicss-intellisense",
5+
]
6+
}

.vscode/settings.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"typescript.tsdk": "node_modules/typescript/lib",
3+
"editor.codeActionsOnSave": {
4+
"source.fixAll.eslint": true,
5+
},
6+
"editor.formatOnSave": true,
7+
}

README.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Vue 3 + Typescript + Vite
2+
3+
This template should help get you started developing with Vue 3 and Typescript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
4+
5+
## Recommended IDE Setup
6+
7+
- [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar)
8+
9+
## Type Support For `.vue` Imports in TS
10+
11+
Since TypeScript cannot handle type information for `.vue` imports, they are shimmed to be a generic Vue component type by default. In most cases this is fine if you don't really care about component prop types outside of templates. However, if you wish to get actual prop types in `.vue` imports (for example to get props validation when using manual `h(...)` calls), you can enable Volar's `.vue` type support plugin by running `Volar: Switch TS Plugin on/off` from VSCode command palette.

index.html

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" href="/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite App</title>
8+
</head>
9+
<body>
10+
<div id="app"></div>
11+
<script type="module" src="/src/main.ts"></script>
12+
</body>
13+
</html>

0 commit comments

Comments
 (0)