Skip to content

Commit 4b8e5da

Browse files
committed
🧹 Add prettierrc
1 parent dadb9aa commit 4b8e5da

File tree

21 files changed

+181
-189
lines changed

21 files changed

+181
-189
lines changed

‎.github/workflows/primary.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- uses: actions/setup-node@v4
2424
with:
2525
node-version: 22
26-
cache: "pnpm"
26+
cache: 'pnpm'
2727

2828
- run: pnpm install --frozen-lockfile
2929

‎.prettierrc‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "all",
4+
"printWidth": 100,
5+
"semi": true,
6+
"tabWidth": 2
7+
}

‎README.md‎

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -88,19 +88,19 @@ children: []
8888
- `Span`
8989

9090
```yaml
91-
type: "Emphasis"
92-
id: "i-am-an-emphasis"
91+
type: 'Emphasis'
92+
id: 'i-am-an-emphasis'
9393
classes:
9494
- emphasized
9595
data:
96-
note: "example"
96+
note: 'example'
9797
children:
98-
- type: "Text"
99-
value: "Hello world"
100-
- type: "Strong"
98+
- type: 'Text'
99+
value: 'Hello world'
100+
- type: 'Strong'
101101
children:
102-
- type: "Text"
103-
value: "This is strong text."
102+
- type: 'Text'
103+
value: 'This is strong text.'
104104
```
105105

106106
### Block Nodes
@@ -113,13 +113,13 @@ children:
113113
- `Div`
114114

115115
```yaml
116-
type: "Heading"
117-
id: "intro"
116+
type: 'Heading'
117+
id: 'intro'
118118
level: 2
119119
classes: [highlighted]
120120
children:
121-
- type: "Text"
122-
value: "Introduction"
121+
- type: 'Text'
122+
value: 'Introduction'
123123
```
124124

125125
## The Document Node
@@ -130,29 +130,29 @@ All OXA documents are valid JSON structures that conform to the root `OXA` schem
130130
type: OXA
131131
version: 0.0.1
132132
metadata:
133-
license: "CC-BY-4.0"
134-
author: "Jane Doe"
133+
license: 'CC-BY-4.0'
134+
author: 'Jane Doe'
135135
title:
136136
- type: Text
137-
value: "Hello, World"
137+
value: 'Hello, World'
138138
children:
139139
- type: Heading
140140
level: 1
141141
children:
142142
- type: Text
143-
value: "Heading One"
143+
value: 'Heading One'
144144
- type: Paragraph
145145
children:
146146
- type: Text
147-
value: "Hello world with the "
147+
value: 'Hello world with the '
148148
- type: InlineMath
149149
value: '\pi'
150150
- type: Text
151-
value: " and "
151+
value: ' and '
152152
- type: InlineCode
153-
value: "1 + 2"
153+
value: '1 + 2'
154154
- type: Text
155-
value: " and foo."
155+
value: ' and foo.'
156156
- type: CodeBlock
157157
data:
158158
executable: true
@@ -202,12 +202,12 @@ Each document can include licensing and rights metadata:
202202

203203
```yaml
204204
license:
205-
name: "CC-BY-SA-4.0"
205+
name: 'CC-BY-SA-4.0'
206206
text: |
207207
Licensed under Creative Commons Attribution-ShareAlike 4.0.
208208
attribution: |
209209
Please credit the University of California, Davis.
210-
source: "https://creativecommons.org/licenses/by-sa/4.0/"
210+
source: 'https://creativecommons.org/licenses/by-sa/4.0/'
211211
```
212212

213213
OXA can generate:

‎eslint.config.js‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
// @ts-check
2-
import eslint from "@eslint/js";
3-
import { defineConfig } from "eslint/config";
4-
import tseslint from "typescript-eslint";
2+
import eslint from '@eslint/js';
3+
import { defineConfig } from 'eslint/config';
4+
import tseslint from 'typescript-eslint';
55

6-
export default defineConfig(
7-
eslint.configs.recommended,
8-
tseslint.configs.recommended,
9-
);
6+
export default defineConfig(eslint.configs.recommended, tseslint.configs.recommended);

‎oxa-human-readable.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
2-
title: "**DRAFT**: Declaring OXA representations from human-readable outputs"
2+
title: '**DRAFT**: Declaring OXA representations from human-readable outputs'
33
date: 2025-11-10
44
author: Carlos Scheidegger
5-
license: "CC BY 4.0"
5+
license: 'CC BY 4.0'
66
---
77

88
## Intro

‎packages/oxa-types-ts/README.md‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@ npm install oxa-types
1111
## Usage
1212

1313
```typescript
14-
import type { Document, Block, Inline, Paragraph, Text } from "oxa-types";
14+
import type { Document, Block, Inline, Paragraph, Text } from 'oxa-types';
1515

1616
const doc: Document = {
17-
type: "Document",
17+
type: 'Document',
1818
metadata: {},
19-
title: [{ type: "Text", value: "Hello", classes: [], data: {} }],
19+
title: [{ type: 'Text', value: 'Hello', classes: [], data: {} }],
2020
children: [
2121
{
22-
type: "Paragraph",
22+
type: 'Paragraph',
2323
classes: [],
2424
data: {},
25-
children: [{ type: "Text", value: "World", classes: [], data: {} }],
25+
children: [{ type: 'Text', value: 'World', classes: [], data: {} }],
2626
},
2727
],
2828
};
@@ -33,10 +33,10 @@ The types include discriminated unions for `Block` and `Inline`, enabling type-s
3333
```typescript
3434
function getTextContent(inline: Inline): string {
3535
switch (inline.type) {
36-
case "Text":
36+
case 'Text':
3737
return inline.value;
38-
case "Strong":
39-
return inline.children.map(getTextContent).join("");
38+
case 'Strong':
39+
return inline.children.map(getTextContent).join('');
4040
}
4141
}
4242
```

‎packages/oxa-types-ts/src/index.ts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export interface Document {
1212
/**
1313
* The type discriminator for Document nodes.
1414
*/
15-
type: "Document";
15+
type: 'Document';
1616
/**
1717
* A unique identifier for the node.
1818
*/
@@ -46,7 +46,7 @@ export interface Heading {
4646
/**
4747
* The type discriminator for Heading nodes.
4848
*/
49-
type: "Heading";
49+
type: 'Heading';
5050
/**
5151
* A unique identifier for the node.
5252
*/
@@ -76,7 +76,7 @@ export interface Paragraph {
7676
/**
7777
* The type discriminator for Paragraph nodes.
7878
*/
79-
type: "Paragraph";
79+
type: 'Paragraph';
8080
/**
8181
* A unique identifier for the node.
8282
*/
@@ -102,7 +102,7 @@ export interface Strong {
102102
/**
103103
* The type discriminator for Strong nodes.
104104
*/
105-
type: "Strong";
105+
type: 'Strong';
106106
/**
107107
* A unique identifier for the node.
108108
*/
@@ -128,7 +128,7 @@ export interface Text {
128128
/**
129129
* The type discriminator for Text nodes.
130130
*/
131-
type: "Text";
131+
type: 'Text';
132132
/**
133133
* A unique identifier for the node.
134134
*/

‎schema/Block.yaml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
$schema: "http://json-schema.org/draft-07/schema#"
1+
$schema: 'http://json-schema.org/draft-07/schema#'
22
$id: Block
33
title: Block
44
description: Union of all block content types.
55
anyOf:
6-
- $ref: "./Heading.yaml"
7-
- $ref: "./Paragraph.yaml"
6+
- $ref: './Heading.yaml'
7+
- $ref: './Paragraph.yaml'

‎schema/Document.yaml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: "http://json-schema.org/draft-07/schema#"
1+
$schema: 'http://json-schema.org/draft-07/schema#'
22
$id: Document
33
title: Document
44
description: A document with metadata, title, and block content.
@@ -27,12 +27,12 @@ properties:
2727
description: The document title as inline content.
2828
type: array
2929
items:
30-
$ref: "./Inline.yaml"
30+
$ref: './Inline.yaml'
3131
children:
3232
description: The block content of the document.
3333
type: array
3434
items:
35-
$ref: "./Block.yaml"
35+
$ref: './Block.yaml'
3636
required:
3737
- type
3838
- metadata

‎schema/Heading.yaml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: "http://json-schema.org/draft-07/schema#"
1+
$schema: 'http://json-schema.org/draft-07/schema#'
22
$id: Heading
33
title: Heading
44
description: A heading with a level and inline content.
@@ -28,7 +28,7 @@ properties:
2828
description: The inline content of the heading.
2929
type: array
3030
items:
31-
$ref: "./Inline.yaml"
31+
$ref: './Inline.yaml'
3232
required:
3333
- type
3434
- level

0 commit comments

Comments
 (0)