Created
January 17, 2021 05:50
-
-
Save eduardolat/579839642f895832c2736a76524e2489 to your computer and use it in GitHub Desktop.
Expresiones regulares para adaptar snippets a React
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"replace-on-save": { | |
"enabled": true, | |
"replacements": [ | |
{ | |
"languageIdentifiers": ["javascriptreact", "jsx"], | |
"rules": [ | |
{ | |
"search": "class=\"", | |
"replace": "className=\"" | |
}, | |
{ | |
"search": "(?<=(<.*[class|className]=\"))([\\s]+)(?=([\\S\\s]{1,})?\".*>)", | |
"replace": "" | |
}, | |
{ | |
"search": "(?<=(<.*[class|className]=\"([\\S\\s]{1,})?))([\\s]+)(?=\".*>)", | |
"replace": "" | |
} | |
] | |
} | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment