These example configurations are designed to support common use cases. You can customize these configurations or combine options from several, or you can create multiple configurations for different projects or use cases.
{
"configurations": {
"JSX Recipe": {
"jsx": true
}
}
}
{
"configurations": {
"TypeScript Recipe": {
"typescript": true
}
}
}
{
"configurations": {
"TSX Recipe": {
"jsx": true,
"typescript": true
}
}
}
For Styled Components version 5.
{
"configurations": {
"Styled Components Recipe": {
"custom_templates": {
"styled_components": true,
"tags": {
"css": "scope:source.js.css",
"createGlobalStyle": "scope:source.css", // v4 and above
"injectGlobal": "scope:source.css", // before v4
}
}
}
}
}
{
"configurations": {
"Emotion.js Recipe": {
"custom_templates": {
"styled_components": true, // If you use @emotions/styled
"tags": {
"css": "scope:source.js.css",
}
}
}
}
}
Requires the GraphQL package.
{
"configurations": {
"GraphQL Recipe": {
"custom_templates": {
"tags": {
// If you use GraphQL tags:
// const fragment = gql`
// fragment User on User {
// …
// `;
"gql": "scope:source.graphql",
},
"comments": {
// const fragment = /* GraphQL */`
// fragment User on User {
// ...
// `;
"GraphQL": "scope:source.graphql",
}
}
}
}
}
Highlight template strings as HTML:
{
"configurations": {
"HTML Recipe": {
"custom_templates": {
// To highlight any untagged template as HTML
"default": "scope:text.html.basic",
"lookaheads": {
// To highlight `<div>Hello, World!</div>`
"<": "scope:text.html.basic",
},
"comments": {
// To highlight /*html*/`<div>Hello, World!</div>`
"html": "scope:text.html.basic",
},
"tags": {
// To highlight html`<div>Hello, World!</div>`
"html": "scope:text.html.basic",
}
}
}
}
}