Skip to content

Commit 89f763a

Browse files
committed
Merge branch 'dev' of https://gitee.com/continew/continew-admin-ui into dev
2 parents abb6d59 + 881c7e7 commit 89f763a

File tree

191 files changed

+7857
-5798
lines changed

Some content is hidden

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

191 files changed

+7857
-5798
lines changed

config/plugins/app-info.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ export default function appInfo(): Plugin {
1616
padding: 1,
1717
margin: 1,
1818
borderStyle: 'double',
19-
textAlignment: 'center'
20-
}
21-
)
19+
textAlignment: 'center',
20+
},
21+
),
2222
)
23-
}
23+
},
2424
}
2525
}

config/plugins/auto-import.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@ import autoImport from 'unplugin-auto-import/vite'
22

33
export default function createAutoImport() {
44
return autoImport({
5-
// 自动导入 vue 相关函数,如: ref、reactive、toRef等
6-
imports: [
7-
'vue',
8-
'vue-router',
9-
'pinia'
10-
],
11-
dts: './src/types/auto-imports.d.ts'
5+
// 自动导入 vue 相关函数
6+
imports: ['vue', 'vue-router', {
7+
// vue 3.5.x
8+
vue: ['useTemplateRef', 'onWatcherCleanup', 'useId'],
9+
}],
10+
dts: './src/types/auto-imports.d.ts',
1211
})
1312
}

config/plugins/components.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ export default function createComponents() {
66
dirs: ['src/components'],
77
extensions: ['vue', 'tsx'],
88
// 配置文件生成位置
9-
dts: './src/types/components.d.ts'
9+
dts: './src/types/components.d.ts',
1010
})
1111
}

config/plugins/mock.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ export default function createMock(env, isBuild) {
1212
injectCode: `
1313
import { setupProdMockServer } from '../src/mock/index';
1414
setupProdMockServer();
15-
`
15+
`,
1616
})
1717
}

config/plugins/svg-icon.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ export default function createSvgIcon(isBuild) {
88
iconDirs: [path.resolve(process.cwd(), 'src/assets/icons')],
99
// 指定 symbolId 格式
1010
symbolId: 'icon-[dir]-[name]',
11-
svgoOptions: isBuild
11+
svgoOptions: isBuild,
1212
})
1313
}

eslint.config.js

Lines changed: 32 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -3,54 +3,42 @@ import antfu from '@antfu/eslint-config'
33
// https://github.com/antfu/eslint-config
44
export default antfu(
55
{
6-
vue: true,
6+
vue: {
7+
overrides: {
8+
'vue/block-order': ['error', {
9+
order: [['script', 'template'], 'style'],
10+
}], // 强制组件顶级元素的顺序
11+
'vue/singleline-html-element-content-newline': 'off', // 要求在单行元素的内容前后换行
12+
'vue/html-self-closing': ['off', {
13+
html: {
14+
void: 'never',
15+
normal: 'always',
16+
component: 'never',
17+
},
18+
}], // 强制自结束样式
19+
'vue/custom-event-name-casing': ['error', 'kebab-case'], // 对自定义事件名称强制使用特定大小写
20+
},
21+
},
722
typescript: true,
823
ignores: [
9-
'README.md',
10-
'src/types/shims-vue.d.ts'
11-
]
24+
'**/*.md',
25+
'.github',
26+
'.image',
27+
'src/types/shims-vue.d.ts',
28+
],
1229
},
1330
{
14-
// Remember to specify the file glob here, otherwise it might cause the vue plugin to handle non-vue files
15-
files: ['**/*.vue'],
1631
rules: {
17-
'vue/block-order': [2, {
18-
order: [['script', 'template'], 'style']
19-
}], // 强制组件顶级元素的顺序
20-
'vue/html-self-closing': [0, {
21-
html: {
22-
void: 'never',
23-
normal: 'always',
24-
component: 'never'
25-
}
26-
}], // 强制自结束样式
27-
'vue/custom-event-name-casing': [2, 'kebab-case'], // 对自定义事件名称强制使用特定大小写
28-
'vue/singleline-html-element-content-newline': 0, // 要求在单行元素的内容前后换行
29-
'vue/first-attribute-linebreak': 0, // 强制第一个属性的位置
30-
'vue/define-macros-order': [2, {
31-
order: ['defineOptions', 'defineModel', 'defineProps', 'defineEmits', 'defineSlots'],
32-
defineExposeLast: false
33-
}], // 强制执行定义限制和定义弹出编译器宏的顺序
34-
'vue/html-indent': 0, // 在《模板》中强制一致的缩进
35-
'vue/html-closing-bracket-newline': 0 // 要求或不允许在标记的右括号前换行
36-
}
32+
'curly': ['off', 'all'], // 对所有控制语句强制使用一致的大括号样式
33+
'no-new': 'off', // 不允许在赋值或比较之外使用 new 运算符
34+
// 'no-console': 'error', // 禁止使用 console
35+
'style/arrow-parens': ['error', 'always'], // 箭头函数参数需要括号
36+
'style/brace-style': ['error', '1tbs', { allowSingleLine: true }], // 对块执行一致的大括号样式
37+
'regexp/no-unused-capturing-group': 'off',
38+
'regexp/no-super-linear-backtracking': 'off',
39+
'node/prefer-global/process': 'off',
40+
'antfu/top-level-function': 'off',
41+
'antfu/if-newline': 'off',
42+
},
3743
},
38-
{
39-
// Without `files`, they are general rules for all files
40-
rules: {
41-
'curly': [0, 'all'], // 对所有控制语句强制使用一致的大括号样式
42-
'dot-notation': 0, // 尽可能强制使用点表示法。 在 JavaScript 中,可以使用点表示法 (foo.bar) 或方括号表示法 (foo["bar"]) 访问属性
43-
'no-new': 0, // 不允许在赋值或比较之外使用 new 运算符
44-
// 'no-console': 2, // 禁止使用 console
45-
'no-process-env': 0,
46-
'style/arrow-parens': [2, 'always'], // 箭头函数参数需要括号
47-
'style/brace-style': [2, '1tbs', { allowSingleLine: true }], // 对块执行一致的大括号样式
48-
'style/comma-dangle': [2, 'never'], // 要求或不允许尾随逗号
49-
'ts/consistent-type-definitions': 0,
50-
'ts/no-unused-expressions': 0,
51-
'node/prefer-global/process': 0,
52-
'antfu/top-level-function': 0,
53-
'antfu/if-newline': 0
54-
}
55-
}
5644
)

package.json

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"build:test": "vue-tsc --noEmit && vite build --mode test",
1010
"preview": "vite preview --port 5050",
1111
"typecheck": "vue-tsc --noEmit",
12-
"lint": "eslint src",
13-
"lint:fix": "eslint src --fix"
12+
"lint": "eslint .",
13+
"lint:fix": "eslint . --fix"
1414
},
1515
"dependencies": {
1616
"@amap/amap-jsapi-loader": "^1.0.1",
@@ -20,6 +20,9 @@
2020
"@codemirror/lang-vue": "^0.1.2",
2121
"@codemirror/theme-one-dark": "^6.1.2",
2222
"@ddietr/codemirror-themes": "^1.4.2",
23+
"@vue-office/docx": "1.6.0",
24+
"@vue-office/excel": "1.7.1",
25+
"@vue-office/pdf": "1.6.4",
2326
"@vueuse/components": "^10.5.0",
2427
"@vueuse/core": "^10.5.0",
2528
"aieditor": "^1.0.13",
@@ -31,6 +34,7 @@
3134
"dayjs": "^1.11.4",
3235
"echarts": "^5.4.2",
3336
"jsencrypt": "^3.3.2",
37+
"lint-staged": "^15.2.10",
3438
"lodash-es": "^4.17.21",
3539
"mitt": "^3.0.0",
3640
"mockjs": "^1.1.0",
@@ -42,7 +46,7 @@
4246
"v-viewer": "^3.0.10",
4347
"viewerjs": "^1.11.6",
4448
"vite-plugin-vue-devtools": "^7.0.27",
45-
"vue": "^3.4.21",
49+
"vue": "^3.5.4",
4650
"vue-codemirror6": "^1.1.27",
4751
"vue-color-kit": "^1.0.5",
4852
"vue-cropper": "^1.1.1",
@@ -52,10 +56,7 @@
5256
"vue-json-pretty": "^2.4.0",
5357
"vue-router": "^4.3.3",
5458
"xe-utils": "^3.5.7",
55-
"xgplayer": "^2.31.6",
56-
"@vue-office/docx": "1.6.0",
57-
"@vue-office/excel": "1.7.1",
58-
"@vue-office/pdf": "1.6.4"
59+
"xgplayer": "^2.31.6"
5960
},
6061
"devDependencies": {
6162
"@antfu/eslint-config": "^2.16.3",
@@ -81,5 +82,11 @@
8182
"vite-plugin-style-import": "^2.0.0",
8283
"vite-plugin-svg-icons": "^2.0.1",
8384
"vue-tsc": "2.0.19"
85+
},
86+
"simple-git-hooks": {
87+
"pre-commit": "pnpm lint-staged"
88+
},
89+
"lint-staged": {
90+
"*": "eslint --fix"
8491
}
8592
}

0 commit comments

Comments
 (0)