Skip to content

Commit 68e8acd

Browse files
author
何嘉悦
committed
feat: 新增全局 Eslint9x oxlint 代码校验, 新增 全量导入组件功能,新增自动全量导出脚本,使用 npm run aeac 即可实现
1 parent c258054 commit 68e8acd

Some content is hidden

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

56 files changed

+4743
-1877
lines changed

.commitlintrc.cjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ module.exports = {
2525
prompt: {
2626
alias: { fd: 'docs: fix typos' },
2727
messages: {
28-
type: "选择你要提交的类型 | Select the type of change that you're committing:",
28+
type: '选择你要提交的类型 | Select the type of change that you\'re committing:',
2929
scope:
3030
'选择一个提交范围(可选)| Denote the SCOPE of this change (optional):',
3131
customScope: '请输入自定义的提交范围 | Denote the SCOPE of this change:',
@@ -113,4 +113,4 @@ module.exports = {
113113
defaultScope: '',
114114
defaultSubject: '',
115115
},
116-
};
116+
}

.npmrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
auto-install-peers=true
2+
node-linker=hoisted
3+
# 强制校验类型完整性
4+
strict-peer-dependencies=true

.oxlint.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# 启用 Vue3 专用规则
2+
enable = ["correctness", "suspicious", "vue"]
3+
4+
# 自定义规则覆盖
5+
[correctness]
6+
noUnusedVariables = "error"
7+
8+
[vue]
9+
noMissingKeysInVFor = "error"

.oxlintrc.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"ignorePatterns": ["**/node_modules/**"],
3+
"rules": {
4+
"no-alert": "error", // Emit an error message when a call to `alert()` is found
5+
"oxc/approx-constant": "warn", // Show a warning when you write a number close to a known constant
6+
"no-plusplus": "off" // Allow using the `++` and `--` operators
7+
},
8+
// Disable all default plugins
9+
"plugins": []
10+
}

.vscode/settings.json

Lines changed: 56 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,58 @@
11
{
2-
"eslint.workingDirectories": [
3-
{
4-
"mode": "auto"
5-
}
6-
]
2+
// 开启扁平化配置
3+
"eslint.useFlatConfig": true,
4+
5+
// 关闭默认的配置,我们这里默认不开启prettier格式化
6+
"prettier.enable": false,
7+
// 关闭默认格式化
8+
"editor.formatOnSave": false,
9+
10+
// 保存自动修复
11+
"editor.codeActionsOnSave": {
12+
// 我们这里是指定自定义的修复
13+
"source.fixAll.eslint": "explicit",
14+
// 来源导入我们不需要给关闭掉
15+
"source.organizeImports": "never",
16+
// 使用 stylelint 来修复样式问题
17+
"source.fixAll.stylelint": "explicit"
18+
},
19+
20+
// 静默样式规则自动修复
21+
"eslint.rules.customizations": [
22+
{ "rule": "style/*", "severity": "off", "fixable": true },
23+
{ "rule": "format/*", "severity": "off", "fixable": true },
24+
{ "rule": "*-indent", "severity": "off", "fixable": true },
25+
{ "rule": "*-spacing", "severity": "off", "fixable": true },
26+
{ "rule": "*-spaces", "severity": "off", "fixable": true },
27+
{ "rule": "*-order", "severity": "off", "fixable": true },
28+
{ "rule": "*-dangle", "severity": "off", "fixable": true },
29+
{ "rule": "*-newline", "severity": "off", "fixable": true },
30+
{ "rule": "*quotes", "severity": "off", "fixable": true },
31+
{ "rule": "*semi", "severity": "off", "fixable": true }
32+
],
33+
34+
// 在eslin中开启哪些语言的校验
35+
"eslint.validate": [
36+
"javascript",
37+
"javascriptreact",
38+
"typescript",
39+
"typescriptreact",
40+
"",
41+
"html",
42+
"markdown",
43+
"json",
44+
"jsonc",
45+
"yaml",
46+
"toml",
47+
"xml",
48+
"gql",
49+
"graphql",
50+
"astro",
51+
"css",
52+
"less",
53+
"scss",
54+
"pcss",
55+
"postcss"
56+
],
57+
"oxc.enable": true
758
}

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ npm install vue-element-plus-x
5656

5757
```vue
5858
<script>
59-
import { BubbleList, Sender } from "vue-element-plus-x";
59+
import { BubbleList, Sender } from 'vue-element-plus-x'
6060
const list = [
6161
{
62-
content: "Hello, Element Plus X",
63-
role: "user",
62+
content: 'Hello, Element Plus X',
63+
role: 'user',
6464
},
65-
];
65+
]
6666
</script>
6767
6868
<template>

apps/docs/components/Bubble.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@ npm i vue-element-plus-x
2626
在你的 Vue 3 项目中引入 `Bubble` 组件:
2727

2828
```vue
29-
<template>
30-
<Bubble :content="yourContent" :typing="true" />
31-
</template>
32-
3329
<script setup>
34-
import { Bubble } from "vue-element-plus-x";
35-
import { ref } from "vue";
30+
import { ref } from 'vue'
31+
import { Bubble } from 'vue-element-plus-x'
3632
37-
const yourContent = ref("This is a bubble content.");
33+
const yourContent = ref('This is a bubble content.')
3834
</script>
35+
36+
<template>
37+
<Bubble :content="yourContent" :typing="true" />
38+
</template>
3939
```
4040

4141
## 四、组件属性
@@ -67,7 +67,7 @@ const yourContent = ref("This is a bubble content.");
6767
<template>
6868
<Bubble>
6969
<template #avatar>
70-
<img src="your-avatar-url" alt="Avatar" />
70+
<img src="your-avatar-url" alt="Avatar">
7171
</template>
7272
</Bubble>
7373
</template>
@@ -137,8 +137,8 @@ const yourContent = ref("This is a bubble content.");
137137

138138
```vue
139139
<template>
140-
<Bubble placement="start" :content="'Left bubble content'" />
141-
<Bubble placement="end" :content="'Right bubble content'" />
140+
<Bubble placement="start" content="Left bubble content" />
141+
<Bubble placement="end" content="Right bubble content" />
142142
</template>
143143
```
144144

@@ -148,11 +148,11 @@ const yourContent = ref("This is a bubble content.");
148148

149149
```vue
150150
<template>
151-
<Bubble shape="round" variant="shadow" :content="'Rounded shadow bubble'" />
151+
<Bubble shape="round" variant="shadow" content="Rounded shadow bubble" />
152152
<Bubble
153153
shape="corner"
154154
variant="outlined"
155-
:content="'Cornered outlined bubble'"
155+
content="Cornered outlined bubble"
156156
/>
157157
</template>
158158
```
@@ -165,7 +165,7 @@ const yourContent = ref("This is a bubble content.");
165165
<template>
166166
<Bubble
167167
:typing="{ speed: 3, suffix: '>' }"
168-
:content="'Typing with custom settings'"
168+
content="Typing with custom settings"
169169
/>
170170
</template>
171171
```
@@ -176,7 +176,7 @@ const yourContent = ref("This is a bubble content.");
176176

177177
```vue
178178
<template>
179-
<Bubble :loading="true" :content="'Loading...'" />
179+
<Bubble :loading="true" content="Loading..." />
180180
<Bubble :loading="true">
181181
<template #loading>
182182
<div>Custom loading spinner...</div>

apps/docs/components/BubbleList.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,30 +26,30 @@ npm i vue-element-plus-x
2626
在你的 Vue 3 项目中引入 `BubbleList` 组件:
2727

2828
```vue
29-
<template>
30-
<BubbleList :list="list" :max-height="'600px'">
31-
<template #avatar="{ item }">
32-
<img :src="item.avatarUrl" alt="Avatar" />
33-
</template>
34-
</BubbleList>
35-
</template>
36-
3729
<script setup>
38-
import { BubbleList } from "vue-element-plus-x";
39-
import { ref } from "vue";
30+
import { ref } from 'vue'
31+
import { BubbleList } from 'vue-element-plus-x'
4032
4133
const list = ref([
4234
{
43-
content: "Hello!",
44-
placement: "start",
35+
content: 'Hello!',
36+
placement: 'start',
4537
loading: false,
46-
shape: "round",
47-
variant: "filled",
38+
shape: 'round',
39+
variant: 'filled',
4840
isMarkdown: false,
4941
typing: false,
5042
},
51-
]);
43+
])
5244
</script>
45+
46+
<template>
47+
<BubbleList :list="list" max-height="600px">
48+
<template #avatar="{ item }">
49+
<img :src="item.avatarUrl" alt="Avatar">
50+
</template>
51+
</BubbleList>
52+
</template>
5353
```
5454

5555
## 四、组件属性
@@ -73,7 +73,7 @@ const list = ref([
7373

7474
```vue
7575
<template #avatar="{ item }">
76-
<img :src="item.avatarUrl" alt="Avatar" />
76+
<img :src="item.avatarUrl" alt="Avatar">
7777
</template>
7878
```
7979

0 commit comments

Comments
 (0)