Skip to content

Commit

Permalink
Merge branch 'dev' of https://gitee.com/continew/continew-admin-ui in…
Browse files Browse the repository at this point in the history
…to dev
  • Loading branch information
han201379873 committed Nov 3, 2024
2 parents abb6d59 + 881c7e7 commit 89f763a
Show file tree
Hide file tree
Showing 191 changed files with 7,857 additions and 5,798 deletions.
8 changes: 4 additions & 4 deletions config/plugins/app-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ export default function appInfo(): Plugin {
padding: 1,
margin: 1,
borderStyle: 'double',
textAlignment: 'center'
}
)
textAlignment: 'center',
},
),
)
}
},
}
}
13 changes: 6 additions & 7 deletions config/plugins/auto-import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ import autoImport from 'unplugin-auto-import/vite'

export default function createAutoImport() {
return autoImport({
// 自动导入 vue 相关函数,如: ref、reactive、toRef等
imports: [
'vue',
'vue-router',
'pinia'
],
dts: './src/types/auto-imports.d.ts'
// 自动导入 vue 相关函数
imports: ['vue', 'vue-router', {
// vue 3.5.x
vue: ['useTemplateRef', 'onWatcherCleanup', 'useId'],
}],
dts: './src/types/auto-imports.d.ts',
})
}
2 changes: 1 addition & 1 deletion config/plugins/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ export default function createComponents() {
dirs: ['src/components'],
extensions: ['vue', 'tsx'],
// 配置文件生成位置
dts: './src/types/components.d.ts'
dts: './src/types/components.d.ts',
})
}
2 changes: 1 addition & 1 deletion config/plugins/mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ export default function createMock(env, isBuild) {
injectCode: `
import { setupProdMockServer } from '../src/mock/index';
setupProdMockServer();
`
`,
})
}
2 changes: 1 addition & 1 deletion config/plugins/svg-icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ export default function createSvgIcon(isBuild) {
iconDirs: [path.resolve(process.cwd(), 'src/assets/icons')],
// 指定 symbolId 格式
symbolId: 'icon-[dir]-[name]',
svgoOptions: isBuild
svgoOptions: isBuild,
})
}
76 changes: 32 additions & 44 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,54 +3,42 @@ import antfu from '@antfu/eslint-config'
// https://github.com/antfu/eslint-config
export default antfu(
{
vue: true,
vue: {
overrides: {
'vue/block-order': ['error', {
order: [['script', 'template'], 'style'],
}], // 强制组件顶级元素的顺序
'vue/singleline-html-element-content-newline': 'off', // 要求在单行元素的内容前后换行
'vue/html-self-closing': ['off', {
html: {
void: 'never',
normal: 'always',
component: 'never',
},
}], // 强制自结束样式
'vue/custom-event-name-casing': ['error', 'kebab-case'], // 对自定义事件名称强制使用特定大小写
},
},
typescript: true,
ignores: [
'README.md',
'src/types/shims-vue.d.ts'
]
'**/*.md',
'.github',
'.image',
'src/types/shims-vue.d.ts',
],
},
{
// Remember to specify the file glob here, otherwise it might cause the vue plugin to handle non-vue files
files: ['**/*.vue'],
rules: {
'vue/block-order': [2, {
order: [['script', 'template'], 'style']
}], // 强制组件顶级元素的顺序
'vue/html-self-closing': [0, {
html: {
void: 'never',
normal: 'always',
component: 'never'
}
}], // 强制自结束样式
'vue/custom-event-name-casing': [2, 'kebab-case'], // 对自定义事件名称强制使用特定大小写
'vue/singleline-html-element-content-newline': 0, // 要求在单行元素的内容前后换行
'vue/first-attribute-linebreak': 0, // 强制第一个属性的位置
'vue/define-macros-order': [2, {
order: ['defineOptions', 'defineModel', 'defineProps', 'defineEmits', 'defineSlots'],
defineExposeLast: false
}], // 强制执行定义限制和定义弹出编译器宏的顺序
'vue/html-indent': 0, // 在《模板》中强制一致的缩进
'vue/html-closing-bracket-newline': 0 // 要求或不允许在标记的右括号前换行
}
'curly': ['off', 'all'], // 对所有控制语句强制使用一致的大括号样式
'no-new': 'off', // 不允许在赋值或比较之外使用 new 运算符
// 'no-console': 'error', // 禁止使用 console
'style/arrow-parens': ['error', 'always'], // 箭头函数参数需要括号
'style/brace-style': ['error', '1tbs', { allowSingleLine: true }], // 对块执行一致的大括号样式
'regexp/no-unused-capturing-group': 'off',
'regexp/no-super-linear-backtracking': 'off',
'node/prefer-global/process': 'off',
'antfu/top-level-function': 'off',
'antfu/if-newline': 'off',
},
},
{
// Without `files`, they are general rules for all files
rules: {
'curly': [0, 'all'], // 对所有控制语句强制使用一致的大括号样式
'dot-notation': 0, // 尽可能强制使用点表示法。 在 JavaScript 中,可以使用点表示法 (foo.bar) 或方括号表示法 (foo["bar"]) 访问属性
'no-new': 0, // 不允许在赋值或比较之外使用 new 运算符
// 'no-console': 2, // 禁止使用 console
'no-process-env': 0,
'style/arrow-parens': [2, 'always'], // 箭头函数参数需要括号
'style/brace-style': [2, '1tbs', { allowSingleLine: true }], // 对块执行一致的大括号样式
'style/comma-dangle': [2, 'never'], // 要求或不允许尾随逗号
'ts/consistent-type-definitions': 0,
'ts/no-unused-expressions': 0,
'node/prefer-global/process': 0,
'antfu/top-level-function': 0,
'antfu/if-newline': 0
}
}
)
21 changes: 14 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"build:test": "vue-tsc --noEmit && vite build --mode test",
"preview": "vite preview --port 5050",
"typecheck": "vue-tsc --noEmit",
"lint": "eslint src",
"lint:fix": "eslint src --fix"
"lint": "eslint .",
"lint:fix": "eslint . --fix"
},
"dependencies": {
"@amap/amap-jsapi-loader": "^1.0.1",
Expand All @@ -20,6 +20,9 @@
"@codemirror/lang-vue": "^0.1.2",
"@codemirror/theme-one-dark": "^6.1.2",
"@ddietr/codemirror-themes": "^1.4.2",
"@vue-office/docx": "1.6.0",
"@vue-office/excel": "1.7.1",
"@vue-office/pdf": "1.6.4",
"@vueuse/components": "^10.5.0",
"@vueuse/core": "^10.5.0",
"aieditor": "^1.0.13",
Expand All @@ -31,6 +34,7 @@
"dayjs": "^1.11.4",
"echarts": "^5.4.2",
"jsencrypt": "^3.3.2",
"lint-staged": "^15.2.10",
"lodash-es": "^4.17.21",
"mitt": "^3.0.0",
"mockjs": "^1.1.0",
Expand All @@ -42,7 +46,7 @@
"v-viewer": "^3.0.10",
"viewerjs": "^1.11.6",
"vite-plugin-vue-devtools": "^7.0.27",
"vue": "^3.4.21",
"vue": "^3.5.4",
"vue-codemirror6": "^1.1.27",
"vue-color-kit": "^1.0.5",
"vue-cropper": "^1.1.1",
Expand All @@ -52,10 +56,7 @@
"vue-json-pretty": "^2.4.0",
"vue-router": "^4.3.3",
"xe-utils": "^3.5.7",
"xgplayer": "^2.31.6",
"@vue-office/docx": "1.6.0",
"@vue-office/excel": "1.7.1",
"@vue-office/pdf": "1.6.4"
"xgplayer": "^2.31.6"
},
"devDependencies": {
"@antfu/eslint-config": "^2.16.3",
Expand All @@ -81,5 +82,11 @@
"vite-plugin-style-import": "^2.0.0",
"vite-plugin-svg-icons": "^2.0.1",
"vue-tsc": "2.0.19"
},
"simple-git-hooks": {
"pre-commit": "pnpm lint-staged"
},
"lint-staged": {
"*": "eslint --fix"
}
}
Loading

0 comments on commit 89f763a

Please sign in to comment.