Skip to content

Commit 81ddaf1

Browse files
committed
feat(sg): convert tagName and attributeName to pascal-case
1 parent b777365 commit 81ddaf1

File tree

2 files changed

+48
-2
lines changed

2 files changed

+48
-2
lines changed

playground/src/App.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ const compRef = shallowRef()
2222
v-on="on"
2323
@click.once="select = i"
2424
@submit="alert"
25-
@update="select.id = $event"
25+
@update:model-value="select.id = $event"
2626
>
2727
<template v-slot:default="{ id }">
28-
<div>{{ id }}</div>
28+
<el-input>{{ id }}</el-input>
2929
</template>
3030
<template #bottom="{ foo }">
3131
<div>{{ `${foo}` }}</div>
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
id: v-pascal-case for tagName
2+
language: tsx
3+
rule:
4+
kind: identifier
5+
pattern: $A
6+
regex: '-'
7+
inside:
8+
any:
9+
- kind: jsx_opening_element
10+
- kind: jsx_closing_element
11+
- kind: jsx_self_closing_element
12+
transform:
13+
B:
14+
convert:
15+
source: $A
16+
toCase: pascalCase
17+
separatedBy: [dash]
18+
fix:
19+
$B
20+
21+
---
22+
23+
id: v-pascal-case for attributeName
24+
language: tsx
25+
rule:
26+
any:
27+
- kind: property_identifier
28+
pattern: $A
29+
regex: ^[^v]-
30+
- kind: identifier
31+
pattern: $A
32+
regex: '-'
33+
follows:
34+
kind: identifier
35+
stopBy: end
36+
inside:
37+
kind: jsx_namespace_name
38+
39+
transform:
40+
B:
41+
convert:
42+
source: $A
43+
toCase: camelCase
44+
separatedBy: [dash]
45+
fix:
46+
$B

0 commit comments

Comments
 (0)