Show Options
in the bottom left of the playground
{% extends "base.html" %}
{% block content %}
<h1 class="title">:-)</h1>
{% endblock content %}
{% extends "base.html" %} {% block content %}
<h1 class="title">:-(</h1>
{% endblock content %}
name
, parsers
and extensions
in languages
. Am I missing something? Is it at all possible? I tested with the following example.console.log(html`<DIV> </DIV>`); // works
console.log(sql`CREATE TABLE example ( id INT PRIMARY KEY );`); // doesn't work
import { MigrationInterface, QueryRunner } from 'typeorm';
export class CreateExtensionPgcrypto1616393535319 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(sql`
CREATE EXTENSION IF NOT EXISTS pgcrypto;
`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(sql`
DROP EXTENSION pgcrypto;
`);
}
}
npx prettier --write --tab-width 2 "**/*.ts"
to format the code in 2 spaces, but it also makes other changes like changing single quotes by double quotes...I was a graphic designer in a previous career and have some knowledge around typography and design. Is there any way prettier could format based off consistency within the file / block as opposed to line by line. So instead of some lines being broken, it finds consistency with previous lines.
So you end up with this:
const foo = ({ polo }) => {
const functionOne = () => myArray.map(item => (item.something === polo))
const functionTwo = () => myArrayWithLongerName.map(item => (item.somethingElse === polo))
const functionThree = () => myArrayWithLongerName.map(item => (item.somethingElse === polo))
return [ ...functionOne, ...functionTwo, ...functionThree ]
}
or this:
const foo = ({ polo }) => {
const functionOne = () => myArray.map(
item => (item.something === polo)
)
const functionTwo = () => myArrayWithLongerName.map(
item => (item.somethingElse === polo)
)
const functionThree = () => myArrayWithLongerName.map(
item => (item.somethingElse === polo)
)
return [ ...functionOne, ...functionTwo, ...functionThree ]
}
instead of this:
const foo = ({ polo }) => {
const functionOne = () => myArray.map(item => (item.something === polo))
const functionTwo = () => myArrayWithLongerName.map(
item => (item.somethingElse === polo)
)
const functionThree = () => myArrayWithLongerName.map(
item => (item.somethingElse === polo)
)
return [ ...functionOne, ...functionTwo, ...functionThree ]
}
Shouldn't prettier avoid formatting <pre> content? It doesn't seem to be doing that though.