From 1411fec0c02711f77ed8a176c5e64fbcdb64c5f1 Mon Sep 17 00:00:00 2001 From: Eemeli Aro Date: Tue, 19 Sep 2023 11:01:40 +0300 Subject: [PATCH] style: Prefer single quotes --- package.json | 3 +++ spec/data-model/README.md | 22 +++++++++++----------- spec/syntax.md | 2 +- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 32e449e166..e56b678bd7 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,9 @@ "dependencies": { "prettier": "^3.0.1" }, + "prettier": { + "singleQuote": true + }, "scripts": { "prettier": "prettier --write docs/ exploration/ spec/" } diff --git a/spec/data-model/README.md b/spec/data-model/README.md index 6632211e90..30549a40a4 100644 --- a/spec/data-model/README.md +++ b/spec/data-model/README.md @@ -29,13 +29,13 @@ A message without _selectors_ and with a single _pattern_ is represented by a `P type Message = PatternMessage | SelectMessage; interface PatternMessage { - type: "message"; + type: 'message'; declarations: Declaration[]; pattern: Pattern; } interface SelectMessage { - type: "select"; + type: 'select'; declarations: Declaration[]; selectors: Expression[]; variants: Variant[]; @@ -66,7 +66,7 @@ interface Variant { } interface CatchallKey { - type: "*"; + type: '*'; value?: string; } ``` @@ -89,12 +89,12 @@ interface Pattern { } interface Text { - type: "text"; + type: 'text'; value: string; } interface Expression { - type: "expression"; + type: 'expression'; body: Literal | VariableRef | FunctionRef | Unsupported; } ``` @@ -113,12 +113,12 @@ In a `VariableRef`, the `name` does not include the initial `$` of the _variable ```ts interface Literal { - type: "literal"; + type: 'literal'; value: string; } interface VariableRef { - type: "variable"; + type: 'variable'; name: string; } ``` @@ -135,8 +135,8 @@ Each _option_ is represented by an `Option`. ```ts interface FunctionRef { - type: "function"; - kind: "open" | "close" | "value"; + type: 'function'; + kind: 'open' | 'close' | 'value'; name: string; operand?: Literal | VariableRef; options?: Option[]; @@ -172,8 +172,8 @@ that the implementation attaches to that _annotation_. ```ts interface Unsupported { - type: "unsupported"; - sigil: "!" | "@" | "#" | "%" | "^" | "&" | "*" | "<" | ">" | "/" | "?" | "~"; + type: 'unsupported'; + sigil: '!' | '@' | '#' | '%' | '^' | '&' | '*' | '<' | '>' | '/' | '?' | '~'; source: string; operand?: Literal | VariableRef; } diff --git a/spec/syntax.md b/spec/syntax.md index 099d5a4696..0af58b5f24 100644 --- a/spec/syntax.md +++ b/spec/syntax.md @@ -162,7 +162,7 @@ An empty string is not a _well-formed_ _message_. > The same _message_ defined inline in JavaScript: > > ```js -> let hello = new MessageFormat("{Hello, world!}"); +> let hello = new MessageFormat('{Hello, world!}'); > hello.format(); > ```