Skip to content

Commit 4ad9daa

Browse files
committed
feat(sg): remove transform v-on
1 parent 028e4af commit 4ad9daa

File tree

1 file changed

+9
-37
lines changed

1 file changed

+9
-37
lines changed

src/sg/rules/jsx-directive/v-on.yml

+9-37
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,20 @@
1-
id: v-on shorthand
1+
id: v-on
22
language: html
33
rule:
4-
kind: attribute
5-
has:
6-
kind: attribute_name
7-
regex: ^@
8-
pattern: $NAME
9-
precedes:
10-
kind: quoted_attribute_value
11-
has:
12-
kind: attribute_value
13-
pattern: $V
14-
stopBy: end
4+
kind: attribute_name
5+
regex: '^@|v-on:'
6+
pattern: $NAME
157
transform:
168
B:
17-
substring:
18-
startChar: 1
19-
endChar: 2
9+
replace:
10+
replace: '^@|v-on:'
11+
by: ''
2012
source: $NAME
2113
C:
2214
convert:
2315
source: $B
24-
toCase: upperCase
25-
D:
26-
substring:
27-
startChar: 2
28-
source: $NAME
29-
K:
30-
replace:
31-
replace: \.
32-
by: _
33-
source: $D
34-
fix: |-
35-
on$C$K={$V}
36-
37-
---
38-
39-
id: v-on to on
40-
language: tsx
41-
rule:
42-
kind: property_identifier
43-
regex: ^v-on$
44-
fix:
45-
on
16+
toCase: capitalize
17+
fix: on$C
4618

4719
---
4820

0 commit comments

Comments
 (0)