Revert "feat:git提交钩子(prettier格式化)"

This reverts commit 1366042f19.
This commit is contained in:
秋帆
2024-06-02 16:00:29 +08:00
parent 1366042f19
commit 67802827ba
8 changed files with 811 additions and 823 deletions

View File

@@ -1,7 +0,0 @@
/dist/*
.local
/node_modules/**
**/*.sh
/public/*

View File

@@ -1,13 +0,0 @@
module.exports = {
printWidth: 100, // 单行字符数, 默认80
tabWidth: 2, // 缩进字节数, 默认2
semi: false, // 句尾使用分号, 默认true
singleQuote: true, // 使用单引号代替双引号, 默认false
trailingComma: 'none', // ,多行时尽可能打印尾随逗号 默认'none', 可选: ['none', 'es5', 'all']
endOfLine: 'auto', // 结束行形式, 默认'auto', 结尾是 \n \r \n\r auto
bracketSpacing: true // 在对象前后添加空格-obj: { foo: bar }
// arrowParens: 'avoid', // 在单个箭头函数参数周围加上括号, 默认'avoid', 可选: ['avoid', 'always'] avoid: 尽可能 always: 始终
// bracketSpacing: true, // 在对象文字中打印括号之间的空格, 默认true, 示例: true -- { name: 'abc' } false -- {name:'abc'}
// useTabs: false, // 使用制表符 tab 缩进行而不是空格, 默认false
// jsxSingleQuote: false, // 在JSX中使用单引号代替双引号, 默认false
}

View File

@@ -5,7 +5,7 @@
// Disable the default formatter, use eslint instead // Disable the default formatter, use eslint instead
"prettier.enable": false, "prettier.enable": false,
"editor.formatOnSave": false, "editor.formatOnSave": true,
// Auto fix // Auto fix
"editor.codeActionsOnSave": { "editor.codeActionsOnSave": {

View File

@@ -10,8 +10,7 @@
"preview": "vite preview --port 5050", "preview": "vite preview --port 5050",
"typecheck": "vue-tsc --noEmit", "typecheck": "vue-tsc --noEmit",
"lint": "eslint src", "lint": "eslint src",
"lint:fix": "eslint src --fix", "lint:fix": "eslint src --fix"
"lint:prettier": "prettier --write \"src/**/*.{js,ts,json,tsx,css,less,scss,vue,html,md}\""
}, },
"dependencies": { "dependencies": {
"@amap/amap-jsapi-loader": "^1.0.1", "@amap/amap-jsapi-loader": "^1.0.1",
@@ -70,7 +69,6 @@
"less-loader": "^11.0.0", "less-loader": "^11.0.0",
"lint-staged": "^15.2.2", "lint-staged": "^15.2.2",
"picocolors": "^1.0.0", "picocolors": "^1.0.0",
"prettier": "3.3.0",
"sass": "^1.62.1", "sass": "^1.62.1",
"sass-loader": "^13.2.2", "sass-loader": "^13.2.2",
"simple-git-hooks": "^2.11.1", "simple-git-hooks": "^2.11.1",
@@ -87,9 +85,6 @@
"pre-commit": "npm lint-staged" "pre-commit": "npm lint-staged"
}, },
"lint-staged": { "lint-staged": {
"*": [ "*": "eslint --fix"
"eslint --fix",
"prettier --write 'src/**/*.{js,ts,json,tsx,css,less,scss,vue,html,md}'"
]
} }
} }

1587
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -25,15 +25,14 @@ const props = defineProps({
} }
}) })
const dictItem = computed((): LabelValueState => { const dictItem = computed(() => {
try { try {
return props.dict.find( return props.dict.find((d) => d.value === String(props.value) || d.value === Number(props.value))
(d) => d.value === String(props.value) || d.value === Number(props.value)
) || { label: '', value: '' }
} catch (error) { } catch (error) {
return { label: '', value: '' } return []
} }
}) }
)
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped></style>

View File

@@ -20,7 +20,7 @@
import HeaderRightBar from '../HeaderRightBar/index.vue' import HeaderRightBar from '../HeaderRightBar/index.vue'
import MenuFoldBtn from '../MenuFoldBtn.vue' import MenuFoldBtn from '../MenuFoldBtn.vue'
defineOptions({ name: 'LayoutHeader' }) defineOptions({ name: 'Header' })
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@@ -31,7 +31,6 @@ defineOptions({ name: 'LayoutHeader' })
.header { .header {
display: flex; display: flex;
align-items: center; align-items: center;
.header-right { .header-right {
flex: 1; flex: 1;
overflow: hidden; overflow: hidden;

View File

@@ -13,7 +13,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { useAppStore, useTabsStore } from '@/stores' import { useAppStore, useTabsStore } from '@/stores'
defineOptions({ name: 'LayoutMain' }) defineOptions({ name: 'Main' })
const appStore = useAppStore() const appStore = useAppStore()
const tabsStore = useTabsStore() const tabsStore = useTabsStore()
</script> </script>