Skip to content

Instantly share code, notes, and snippets.

@garmjs
Last active June 18, 2018 18:44
Show Gist options
  • Save garmjs/de7f815fcf6131be2361727202fc5ca4 to your computer and use it in GitHub Desktop.
Save garmjs/de7f815fcf6131be2361727202fc5ca4 to your computer and use it in GitHub Desktop.
Syntax hilighting of tagged template literals in our JavaScript code
function sql(strings, ...others) {
let out = [strings[0]];
for (let i = 0; i < others.length; i++) {
out.push(others[i], strings[i + 1]);
}
return out.join("");
}
// Example URL: https://marketplace.visualstudio.com/items?itemName=forbeslindesay.vscode-sql-template-literal
const query = sql`SELECT * FROM users`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment