3

I have a code snippet in VS Code, looks like this

"JS arrow function": {
    "scope": "javascript, typescript",
    "prefix": "af",
    "body": [
        "const ${1:name} = (${2:props}) => {",
        "   $3",
        "}"
    ],
    "description": "Create arrow function"
}

I want to have tabulation before the $3 tab stop, but VS Code shows an error :

Invalid characters in string. Control characters must be escaped.

At the same time putting 4 spaces before $3 works just fine, but I need tabulation exactly for my eslint config.

Is there a way to put tabulation there?

Slava.In
  • 597
  • 1
  • 9
  • 22

1 Answers1

12

\t

That is the tab character escaped.

"JS arrow function": {
    "scope": "javascript, typescript",
    "prefix": "af",
    "body": [
        "const ${1:name} = (${2:props}) => {",
        "\t$3",
        "}"
    ],
    "description": "Create arrow function"
}
Timothy Alexis Vass
  • 2,526
  • 2
  • 11
  • 30