Last active
February 25, 2024 21:36
-
-
Save vmishakin/db09faf9b95fcfbde6e2448e474f7031 to your computer and use it in GitHub Desktop.
VS Code snippets Variable transforms
This file contains 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
The filename of the current document without its extensions | |
${TM_FILENAME_BASE} | |
Button.ts -> Button | |
The line before the first dot in the filename of the current document | |
Button.test.ts -> Button | |
${TM_FILENAME/([a-z0-9]+)\\..+$/$1/gi} | |
Name of the first subdirectory, after 'src' (detecting FSD layer) | |
${RELATIVE_FILEPATH/src\\/([a-z]+)\\/.*/$1/gi} | |
src/entities/Product/ui/Product/Product.ts -> entities | |
Name of the second subdirectory, after 'src (detecting FSD slice) | |
${RELATIVE_FILEPATH/src\\/[a-z]+\\/([a-z0-9]+)\\/.*/$1/gi} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment