Skip to content

Instantly share code, notes, and snippets.

@eduardolat
Created January 17, 2021 05:50
Show Gist options
  • Save eduardolat/579839642f895832c2736a76524e2489 to your computer and use it in GitHub Desktop.
Save eduardolat/579839642f895832c2736a76524e2489 to your computer and use it in GitHub Desktop.
Expresiones regulares para adaptar snippets a React
{
"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