Skip to content

Commit 4aefefe

Browse files
committed
style: format with prettier v3
1 parent ef3250b commit 4aefefe

File tree

5 files changed

+35
-42
lines changed

5 files changed

+35
-42
lines changed

.eslintrc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
{
2-
"extends": [
3-
"eslint-config-unjs"
4-
],
2+
"extends": ["eslint-config-unjs"],
53
"rules": {
64
"unicorn/no-null": 0,
75
"unicorn/prevent-abbreviations": 0

.github/workflows/autofix.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
name: autofix.ci # needed to securely identify the workflow
1+
name: autofix.ci # needed to securely identify the workflow
22

33
on:
44
pull_request:
55
push:
6-
branches: [ "main" ]
6+
branches: ["main"]
77

88
permissions:
99
contents: read
@@ -24,4 +24,4 @@ jobs:
2424
run: npm run lint:fix
2525
- uses: autofix-ci/action@8caa572fd27b0019a65e4c695447089c8d3138b9
2626
with:
27-
commit-message: 'chore: apply automated lint fixes'
27+
commit-message: "chore: apply automated fixes"

README.md

Lines changed: 27 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -27,30 +27,30 @@ First we have to define a reference object that describes types, defaults, and a
2727

2828
```js
2929
const defaultPlanet = {
30-
name: 'earth',
30+
name: "earth",
3131
specs: {
3232
gravity: {
33-
$resolve: val => parseFloat(val),
34-
$default: '9.8'
33+
$resolve: (val) => parseFloat(val),
34+
$default: "9.8",
3535
},
3636
moons: {
37-
$resolve: (val = ['moon']) => [].concat(val),
37+
$resolve: (val = ["moon"]) => [].concat(val),
3838
$schema: {
39-
title: 'planet moons'
40-
}
41-
}
42-
}
43-
}
39+
title: "planet moons",
40+
},
41+
},
42+
},
43+
};
4444
```
4545

4646
## API
4747

4848
### `resolveSchema`
4949

5050
```js
51-
import { resolveSchema } from 'untyped'
51+
import { resolveSchema } from "untyped";
5252

53-
const schema = await resolveSchema(defaultPlanet)
53+
const schema = await resolveSchema(defaultPlanet);
5454
```
5555

5656
Output:
@@ -70,9 +70,7 @@ Output:
7070
},
7171
"moons": {
7272
"title": "planet moons",
73-
"default": [
74-
"moon"
75-
],
73+
"default": ["moon"],
7674
"type": "array",
7775
"items": [
7876
{
@@ -87,58 +85,60 @@ Output:
8785
"type": "object"
8886
}
8987
```
88+
9089
### `generateTypes`
9190

9291
```js
93-
import { resolveSchema, generateTypes } from 'untyped'
92+
import { resolveSchema, generateTypes } from "untyped";
9493

95-
const types = generateTypes(await resolveSchema(defaultPlanet))
94+
const types = generateTypes(await resolveSchema(defaultPlanet));
9695
```
9796

9897
Output:
9998

10099
```ts
101100
interface Untyped {
102-
/** @default "earth" */
103-
name: string,
101+
/** @default "earth" */
102+
name: string;
104103

105104
specs: {
106105
/** @default 9.8 */
107-
gravity: number,
106+
gravity: number;
108107

109108
/**
110109
* planet moons
111110
* @default ["moon"]
112-
*/
113-
moons: string[],
114-
},
111+
*/
112+
moons: string[];
113+
};
115114
}
116115
```
117116

118117
### `generateMarkdown`
119118

120119
```js
121-
import { resolveSchema, generateMarkdown } from 'untyped'
120+
import { resolveSchema, generateMarkdown } from "untyped";
122121

123-
const markdown = generateMarkdown(await resolveSchema(defaultPlanet))
122+
const markdown = generateMarkdown(await resolveSchema(defaultPlanet));
124123
```
125124

126125
Output:
127126

128127
```markdown
129128
# `name`
129+
130130
- **Type**: `string`
131131
- **Default**: `"earth"`
132132

133-
134133
# `specs`
135134

136135
## `gravity`
136+
137137
- **Type**: `number`
138138
- **Default**: `9.8`
139139

140-
141140
## `moons`
141+
142142
- **Type**: `array`
143143
- **Default**: `["moon"]`
144144
```
@@ -159,17 +159,14 @@ Output:
159159
Thanks to [@dominikschreiber](https://github.com/dominikschreiber) for donating package name.
160160

161161
<!-- Badges -->
162+
162163
[npm-version-src]: https://img.shields.io/npm/v/untyped?style=flat-square
163164
[npm-version-href]: https://npmjs.com/package/untyped
164-
165165
[npm-downloads-src]: https://img.shields.io/npm/dm/untyped?style=flat-square
166166
[npm-downloads-href]: https://npmjs.com/package/untyped
167-
168167
[github-actions-src]: https://img.shields.io/github/actions/workflow/status/unjs/untyped/ci.yml?branch-main&style=flat-square
169168
[github-actions-href]: https://github.com/unjs/untyped/actions?query=workflow%3Aci
170-
171169
[codecov-src]: https://img.shields.io/codecov/c/gh/unjs/untyped/main?style=flat-square
172170
[codecov-href]: https://codecov.io/gh/unjs/untyped
173-
174171
[bundle-src]: https://img.shields.io/bundlephobia/minzip/untyped?style=flat-square
175172
[bundle-href]: https://bundlephobia.com/result?p=untyped

renovate.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
{
2-
"extends": [
3-
"github>unjs/renovate-config"
4-
]
2+
"extends": ["github>unjs/renovate-config"]
53
}

vite.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { defineConfig } from "vitest/config";
33
export default defineConfig({
44
test: {
55
coverage: {
6-
reporter: ["text", "clover", "json"]
7-
}
8-
}
6+
reporter: ["text", "clover", "json"],
7+
},
8+
},
99
});

0 commit comments

Comments
 (0)