Skip to content

Commit

Permalink
feat(sg): remove transform v-on
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiyuanzmj committed Dec 23, 2023
1 parent 028e4af commit 4ad9daa
Showing 1 changed file with 9 additions and 37 deletions.
46 changes: 9 additions & 37 deletions src/sg/rules/jsx-directive/v-on.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,20 @@
id: v-on shorthand
id: v-on
language: html
rule:
kind: attribute
has:
kind: attribute_name
regex: ^@
pattern: $NAME
precedes:
kind: quoted_attribute_value
has:
kind: attribute_value
pattern: $V
stopBy: end
kind: attribute_name
regex: '^@|v-on:'
pattern: $NAME
transform:
B:
substring:
startChar: 1
endChar: 2
replace:
replace: '^@|v-on:'
by: ''
source: $NAME
C:
convert:
source: $B
toCase: upperCase
D:
substring:
startChar: 2
source: $NAME
K:
replace:
replace: \.
by: _
source: $D
fix: |-
on$C$K={$V}
---

id: v-on to on
language: tsx
rule:
kind: property_identifier
regex: ^v-on$
fix:
on
toCase: capitalize
fix: on$C

---

Expand Down

0 comments on commit 4ad9daa

Please sign in to comment.